caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Check failed: cv_img.data Could not load image

Open syedumaramin opened this issue 10 years ago • 8 comments

I am getting the following error when I am trying to initialize caffenet with depth images and weights from pretrained imagenet model.

untrained_sign_net = caffe.Net(sign_net(train=False, subset='train'),weights, caffe.TEST) untrained_sign_net.forward() sign_data_batch = untrained_sign_net.blobs['data'].data.copy() sign_label_batch = np.array(untrained_sign_net.blobs['label'].data, dtype=np.int32)

Its giving me below error:

Could not open or find file /home/umar/caffe/data/sign/images/S01_C01_0001.jpeg

F0403 11:10:06.664624 4562 image_data_layer.cpp:138] Check failed: cv_img.data Could not load /home/umar/caffe/data/sign/images/S01_C01_0001.jpeg

syedumaramin avatar Apr 05 '16 11:04 syedumaramin

Does the image exist, and is it valid?

seanbell avatar Apr 09 '16 23:04 seanbell

Yes the image is available but it was only single channel so the issue is solved by converting it to three channel

syedumaramin avatar Apr 10 '16 12:04 syedumaramin

Could you specify where you made the necessary change, which .prototxt file did you alter? or did you change the file that holds the image url list?

jpsquare avatar Apr 10 '16 16:04 jpsquare

no i just changed my image files to 3 channel which was needed by caffenet

syedumaramin avatar Apr 10 '16 19:04 syedumaramin

So I assume you were using black & white images earlier, and the model worked when color images were used.

jpsquare avatar Apr 11 '16 17:04 jpsquare

yes you are right , I guess I had same problem

On Mon, Apr 11, 2016 at 8:25 PM, Joel Philip [email protected] wrote:

So I assume you were using black & white images earlier, and the model worked when color images were used.

— You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/3945#issuecomment-208459158

syedumaramin avatar Apr 11 '16 18:04 syedumaramin

Yes I resolved this issue by prepending the absolute path to the images in the file holding the image names. Thus the image urls could now be resolved by the opencv methods

jpsquare avatar Apr 14 '16 07:04 jpsquare

I used absolute path, but I still get this error....need some help. Thanks

gxdai avatar Oct 23 '16 16:10 gxdai