With code like this:
net = Net(network_path, TRAIN)
data = array([[sample] for sample in samples[:128]]) # samples are 70x70 ndarrays
And network that starts like:
name: "pymemorydatanet"
layer {
name: "data"
type: "MemoryData"
top: "data"
top: "label"
memory_data_param {
batch_size: 128
channels: 1
height: 70
width: 70
}
}
layer {
name: "conv1"
...
I get the error
File "/home/mark/mlip1/caffe/python/caffe/pycaffe.py", line 84, in _Net_forward
raise Exception('Input blob arguments do not match net inputs.')
I found that this is because list(net._inputs)
is []
, while I think it should be [0]
.
Indeed, for a network like
name: "CaffeNet"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 227
input_dim: 227
layer {
name: "conv1"
...
list(net._inputs) = [0]
and things work.