'Net' object has no attribute 'predict'

541 views
Skip to first unread message

PC

unread,
Jul 20, 2015, 3:07:18 PM7/20/15
to caffe...@googlegroups.com

Hi,


I ran into this error when running the classification ipython notebook example:


'Net' object has no attribute 'predict'


after running the line:


prediction = net.predict([input_image])


Does anyone have any ideas how to resolve this?


Cheers,


pc


Franck Dernoncourt

unread,
Jul 20, 2015, 10:21:05 PM7/20/15
to caffe...@googlegroups.com
Perhaps your net object in an instance of Net, not of Classifier. Only the class Classifier has the attribute 'predict'.

PC

unread,
Jul 21, 2015, 2:31:01 AM7/21/15
to caffe...@googlegroups.com
Relative beginner in python; I get the following error when changing to the class Classifier:

/home/ucpc/caffe/python/caffe/classifier.pyc
in predict(self, inputs, oversample) 63 # Scale to standardize input dimensions. 64 input_ = np.zeros((len(inputs), ---> 65 self.image_dims[0], 66 self.image_dims[1], 67 inputs[0].shape[2])


TypeError: 'int' object has no attribute '__getitem__'
Reply all
Reply to author
Forward
0 new messages