首页 > 解决方案 > 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?

标签: deep-learningcaffepycaffe

解决方案


我认为您的问题是您不知道proposal.
如果是这样,您只需在 prototxt 文件中填充虚拟尺寸并在转发之前对其进行整形。
运行程序后,批量大小会固定,对吗?
然后你可以重塑你的roi_pool_conv5层和你的网络!
我希望这个答案对你有帮助:)


推荐阅读