Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
510 Views

IndexError: list index out of range

@Tome_at_Intel @PINTO Hi, when i try run live-image-classifier.pywith AlexNet and Squeezenet, it returns the error below:

 

python3 live-image-classifier.py --graph ../../caffe/AlexNet//graph --dim 227 227 /usr/local/lib/python3.5/dist-packages/mvnc/mvncapi.py:418: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead tensor = numpy.fromstring(tensor.raw, dtype=numpy.float32) Traceback (most recent call last): File "live-image-classifier.py", line 191, in <module> main() File "live-image-classifier.py", line 137, in main infer_image( graph, img, frame, fifo_in, fifo_out ) File "live-image-classifier.py", line 110, in infer_image + " ( %.2f ms )" % ( numpy.sum( inference_time ) ) ) IndexError: list index out of range

 

python3 live-image-classifier.py --graph ../../caffe/SqueezeNet/graph --dim 227 227 --labels ../../caffe/SqueezeNet/synset_words.txt /usr/local/lib/python3.5/dist-packages/mvnc/mvncapi.py:418: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead tensor = numpy.fromstring(tensor.raw, dtype=numpy.float32) Traceback (most recent call last): File "live-image-classifier.py", line 191, in <module> main() File "live-image-classifier.py", line 137, in main infer_image( graph, img, frame, fifo_in, fifo_out ) File "live-image-classifier.py", line 110, in infer_image + " ( %.2f ms )" % ( numpy.sum( inference_time ) ) ) IndexError: list index out of range

 

i don't know why, please help me! thanks!
0 Kudos
3 Replies
idata
Community Manager
125 Views

by the way,they are running well in the directory ncappzoo/caffe/AlexNetand ncappzoo/caffe/SqueezeNet!

idata
Community Manager
125 Views

@luna The default network for live-image-classifier is to run the GenderNet model. The issue is coming from the fact that the default labels are being used for AlexNet/SqueezeNet and that's why you are seeing this error. If you specify the correct label text file, it should work: python3 live-image-classifier.py --graph ../../caffe/AlexNet/graph --dim 227 227 --labels ../../data/ilsvrc12/synset_words.txt.

 

For the second issue, you are using the wrong label file. Trying using --labels ../../data/ilsvrc12/synset_words.txt so the command will be python3 live-image-classifier.py --graph ../../caffe/Squeeze/graph --dim 227 227 --labels ../../data/ilsvrc12/synset_words.txt.

idata
Community Manager
125 Views

@Tome_at_Intel thanks very much, now it works very well!

Reply