Error in ImageNet Notebook example

197 views
Skip to first unread message

McCaffe

unread,
Sep 3, 2015, 10:04:22 AM9/3/15
to Caffe Users
Hey 

I get an error when working through the imagenet example but cannot figure out how to fix it. It happens when I execute the code in block [6]:
net.blobs['data'].data[...] = transformer.preprocess('data', caffe.io.load_image(caffe_root + 'examples/images/cat.jpg'))
out = net.forward()
print("Predicted class is #{}.".format(out['prob'].argmax()))

It gives me:
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-16-10d7a1cbb39b> in <module>()
      1 net.blobs['data'].data[...] = transformer.preprocess('data', caffe.io.load_image(caffe_root + 'examples/images/cat.jpg'))
      2 out = net.forward()
----> 3 print("Predicted class is #{}.".format(out['prob'].argmax()))

KeyError: 'prob'


Any ideas how to fix that?

McCaffe

unread,
Sep 3, 2015, 10:41:45 AM9/3/15
to Caffe Users
I already found it. I forgot that I already changed my deploy.prototxt file by cutting off the last layer. I restored the old version and now everything is working fine
Reply all
Reply to author
Forward
0 new messages