Pycaffe error with labels

234 views
Skip to first unread message

Prabhu

unread,
Feb 9, 2015, 11:33:28 AM2/9/15
to caffe...@googlegroups.com
Why is this?
My model trained input hd5 data shape is 100,1,96,96 and labels (100,30)

net = caffe.Net(MODEL_FILE,PRETRAINED)
net
.set_mode_cpu()
data4D
= np.zeros([max_value,1,96,96],np.float32)
data4DL
= np.zeros([max_value,30,1,1], np.float32)
data4D
[0:max_value,:] = X[:1000,:,:,:]
net
.set_input_arrays(data4D.astype(np.float32),data4DL.astype(np.float32))
net
.forward()



produces when i set 30 dimensions in labels.

Traceback (most recent call last):
 
File "output.py", line 51, in <module>
    net
.set_input_arrays(data4D.astype(np.float32),data4DL.astype(np.float32))
 
File "/home/pbu/Desktop/caffe/python/caffe/pycaffe.py", line 345, in _Net_set_input_arrays
   
return self._set_input_arrays(data, labels)
RuntimeError: labels array has wrong number of channels




Hongji Wang

unread,
Apr 4, 2015, 5:25:00 PM4/4/15
to caffe...@googlegroups.com
Have you fixed this error? If so, please share. Thanks
Reply all
Reply to author
Forward
0 new messages