weiliu89 / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
4.77k stars 1.68k forks source link

ssd_detect.bin: "Check failed: num_test_image_ <= names_.size()" #452

Open gilshm opened 7 years ago

gilshm commented 7 years ago

I've been trying to use ssd_detect.bin, but I get this error: detection_output_layer.cpp:98] Check failed: num_test_image_ <= names_.size() (4952 vs. 0)

This is the command line I'm using: ./build/examples/ssd/ssd_detect.bin models/VGGNet/VOC0712/SSD_300x300/deploy.prototxt models/VGGNet/VOC0712/SSD_300x300/VGG_VOC0712_SSD_300x300_iter_120000.caffemodel ./examples/ssd/images.txt

images.txt consists with only one image: ./examples/images/cat.jpg

Can you please advise?

Thanks!

gilshm commented 7 years ago

I found out that if I leave the _name_sizefile blank in the .prototxt file it runs. Now that I'm thinking about it, I didn't have the _name_sizefile at the beginning, I just created it without any content in it. What is that file?

MyVanitar commented 7 years ago

Yes, the problem is with that file. That file contains test image names (without jpg or something, only file name) and their resolution for example: (file name is 001.jpg)

001 640 480

albertyou2 commented 7 years ago

@gilshm same problem ,have you found the solution?

ranjithrajasimha commented 7 years ago

@VanitarNordic Thank you, worked for me. :+1:

smartadpole commented 5 years ago

@gilshm same problem ,have you found the solution? update the line in ssd_pascal.py :num_test_image = 4952 to your test images num; 这句话指定了测试图片的数量;你的测试集数量一定是大于等于这个数的,如果小于就会报错;