deep-learning - Exception: Input blob arguments do not match net inputs
问题描述
This question has been asked before but with different context. So please dont mark it as duplicate.
I want to feedforward a network step by step. First feedforward upto some layer then get its result change it and then pass it on to the next layer. Here is the code.
forward_kwargs = {'data': blobs['data'].astype(np.float32, copy=False)}
blobs_out = net.forward(end='proposal',**forward_kwargs)
forward_kwargs = {'proposal': blobs_out}
blobs_out = net.forward(start='roi_pool_conv5',**forward_kwargs)
When it run this code, it gives error
Exception: Input blob arguments do not match net inputs.
this error comes from the file pycaffe.py
. The line in this file giving error is
if set(kwargs.keys()) != set(self.inputs):
raise Exception('Input blob arguments do not match net inputs.')
Because in prototxt file i have mentioned only two inputs data
and im_info
. But i want to input my network again from roi_pool_conv5
layer and when i send this argument as start layer to network it checks whether this blob is in the inputs or not. Clearly it is not in the inputs. I cannot mention this in input because i am unsure of dimension. Any workaround for this?
解决方案
我认为您的问题是您不知道proposal
.
如果是这样,您只需在 prototxt 文件中填充虚拟尺寸并在转发之前对其进行整形。
运行程序后,批量大小会固定,对吗?
然后你可以重塑你的roi_pool_conv5
层和你的网络!
我希望这个答案对你有帮助:)
推荐阅读
- c++ - /usr/bin/bash: g++: 找不到命令
- javascript - React Hooks:设置组件状态而无需重新渲染两次
- python - 数据流:无工作人员活动
- javascript - 滚动时将图像从屏幕中间移动到角落
- json - 在 JQ 映射键值中使用整数
- elasticsearch - MultiMatch 的动态字段列表 - Nest
- java - 如何在使用 MockMVC 测试表单时将集合设置为参数
- html - 是否可以同时使用 ~ 和 + 选择器?
- javascript - Service Worker 可以优先考虑网络访问(即 QoS)吗?
- mysql - 基于最近 10 个日期的 MySQL 嵌套查询