caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Check failed: cv_img.data Could not load examples/images/cat.jpg

Open basuam opened this issue 11 years ago • 12 comments

While running make runtest apparently it is not possible to load the images.

I'm running "make runtest" from the main folder "caffe-master" and the error is as follows...

I have installed CUDA 7.0, cuDNN-v3.0, the latest version of Caffe-master (downloaded two days ago) and the OS is RedHat 6.

Hope you can confirm that this is a BUG

[----------] 4 tests from ImageDataLayerTest/3, where TypeParam = caffe::GPUDevice [ RUN ] ImageDataLayerTest/3.TestShuffle E1120 20:20:07.836431 5387 io.cpp:80] Could not open or find file examples/images/cat.jpg F1120 20:20:07.836463 5387 image_data_layer.cpp:65] Check failed: cv_img.data Could not load examples/images/cat.jpg *** Check failure stack trace: *** @ 0x2b00a03f0b5d google::LogMessage::Fail() @ 0x2b00a03f4b77 google::LogMessage::SendToLog() @ 0x2b00a03f29f9 google::LogMessage::Flush() @ 0x2b00a03f2cfd google::LogMessageFatal::~LogMessageFatal() @ 0x2b00a6c97c0b caffe::ImageDataLayer<>::DataLayerSetUp() @ 0x2b00a6c2f243 caffe::BaseDataLayer<>::LayerSetUp() @ 0x2b00a6c2f2c3 caffe::BasePrefetchingDataLayer<>::LayerSetUp() @ 0x50c35f caffe::Layer<>::SetUp() @ 0x6a589e caffe::ImageDataLayerTest_TestShuffle_Test<>::TestBody() @ 0x8e63f3 testing::internal::HandleExceptionsInMethodIfSupported<>() @ 0x8ded6a testing::Test::Run() @ 0x8deeb8 testing::TestInfo::Run() @ 0x8def95 testing::TestCase::Run() @ 0x8df8c8 testing::internal::UnitTestImpl::RunAllTests() @ 0x8dfba3 testing::UnitTest::Run() @ 0x50439a main @ 0x317581ed5d (unknown) @ 0x504075 (unknown) make: *** [runtest] Aborted (core dumped)

This error is found in other tests...

[ FAILED ] DBTest/0.TestSeekToFirst, where TypeParam = caffe::TypeLevelDB (211 ms) [ RUN ] DBTest/0.TestNext E1120 20:19:36.755816 5387 io.cpp:80] Could not open or find file examples/images/cat.jpg E1120 20:19:36.755985 5387 io.cpp:80] Could not open or find file examples/images/fish-bike.jpg

[ FAILED ] DBTest/0.TestKeyValue, where TypeParam = caffe::TypeLevelDB (185 ms) [ RUN ] DBTest/0.TestSeekToFirst E1120 20:19:36.519708 5387 io.cpp:80] Could not open or find file examples/images/cat.jpg E1120 20:19:36.519881 5387 io.cpp:80] Could not open or find file examples/images/fish-bike.jpg

basuam avatar Nov 21 '15 02:11 basuam

I have met the same problem,,could you tell me how to solve it?Thank you!

iridescent303 avatar Dec 16 '15 15:12 iridescent303

I've met with this problem too, don't know how to handle

ylqfp avatar Mar 14 '16 10:03 ylqfp

did any one find solution to the above issue

syedumaramin avatar Apr 05 '16 10:04 syedumaramin

Is there a solution for this issue?

jpsquare avatar Apr 10 '16 16:04 jpsquare

Hi all, It's because there is non-compatible version of libjpeg in the system. I reinstalled libjpeg module, and finally solved this problem. Just remind, try to test your libjpeg module first and make sure your libjpeg is OK.

ylqfp avatar Apr 11 '16 01:04 ylqfp

@ylqfp, which operating system are you using? and how did u install this module? . Thanks for the help

jpsquare avatar Apr 11 '16 17:04 jpsquare

Hi @jpsquare RHEL 6.5 santigo. Just download source from http://libjpeg.sourceforge.net/ and reinstall following its instructions.

ylqfp avatar Apr 12 '16 13:04 ylqfp

Thanks @ylqfp, 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

Closing, since this seems to be resolved, and related to installation/library problems and not caffe.

seanbell avatar Apr 24 '16 08:04 seanbell

I tried hardcoding the abolute path in include/caffe/test/test_caffe_main.hpp based on the suggestion from @jpsquare above, but I still got the could not load error message, even though the error message now included the full path to the file.

I got around this error by rebuilding OpenCV with the following cmake flags:

-DBUILD_JPEG=ON -DBUILD_PNG=ON -DBUILD_TIFF=ON -DBUILD_ZLIB=ON

so that it could build its own media i/o libraries and not depend on the one found in Anaconda's library path. I probably only needed the JPEG option to get around this error, but I just went ahead and did the others to be consistent.

Hope that helps someone.

giovtorres avatar May 13 '16 12:05 giovtorres

how to hardcode the absolute path in include/caffe/test/test_caffe_main.hpp. Can you specify clearly. I did rebuild opencv with the above cmake.

Thanks!!!!!!!!!!!!!!!!1

pearlmary avatar Jul 19 '17 12:07 pearlmary

I tried hardcoding the abolute path in include/caffe/test/test_caffe_main.hpp based on the suggestion from @jpsquare above, but I still got the could not load error message, even though the error message now included the full path to the file.

I got around this error by rebuilding OpenCV with the following cmake flags:

-DBUILD_JPEG=ON -DBUILD_PNG=ON -DBUILD_TIFF=ON -DBUILD_ZLIB=ON

so that it could build its own media i/o libraries and not depend on the one found in Anaconda's library path. I probably only needed the JPEG option to get around this error, but I just went ahead and did the others to be consistent.

Hope that helps someone.

Thanks!!! I have solved that follow your solutions.

Tclz avatar Dec 19 '20 02:12 Tclz