In 00-classification example, get correct class label index
authorBrian Chu <bc@brianchu.com>
Tue, 13 Oct 2015 10:50:53 +0000 (03:50 -0700)
committerBrian Chu <bc@brianchu.com>
Tue, 13 Oct 2015 10:50:53 +0000 (03:50 -0700)
examples/00-classification.ipynb

index 46bbb19..89b7dd3 100644 (file)
    "source": [
     "net.blobs['data'].data[...] = transformer.preprocess('data', caffe.io.load_image(caffe_root + 'examples/images/cat.jpg'))\n",
     "out = net.forward()\n",
-    "print(\"Predicted class is #{}.\".format(out['prob'].argmax()))"
+    "print(\"Predicted class is #{}.\".format(out['prob'][0].argmax()))"
    ]
   },
   {