1

I want to use Caffe's tool, compute_image_mean to compute the mean image, but the command line tells me that:

This tool requires OpenCV; compile with USE_OPENCV.

I've searched the Internet, and one guy said:

Well, this message suggests that you have compiled caffe without OpenCV, i.e; with USE_OPENCV set to 0 in your Makefile.config. Recompile with that settings commented out (as is the default) and try again. And of course you need to have OpenCV installed for this to work.

But I have already set USE_OPENCV := 0 when I compiled my Caffe.

Could someone help me to solve this problem?

3
  • The error message says literally everything you need to do, what is the question then? What have you tried? Commented Jan 4, 2017 at 14:08
  • But I have compiled with OPENCV and I tried to recompile many times, it seems that Caffe cannot compile without Opencv. So I have no idea why I get this error Commented Jan 4, 2017 at 14:30
  • I guess you haven't installed OpenCV... Or have you installed it manually before trying to install Caffe? If so, it might be that the paths are not set correctly, so Caffe doesn't find OpenCV Commented Jan 4, 2017 at 17:39

3 Answers 3

1

I think you have misread the statement you found, it says you are compiling without OpenCV, which means WITH_OPENCV := 0 , to compile Caffe with OpenCV you have to set WITH_OPENCV := 1 , or just comment it out.

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you, but I try to add WITH_OPENCV := 1 and comment SET_OPENCV:=0, then there will be an error when I compile Caffe: ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error 1 make: *** Waiting for unfinished jobs....
Seems like just using WITH_OPENCV:=1 cannot use opencv when compiling
@LiuChong You should provide the complete error, in a new question, this will indicate what the problem is.
0

I met the same error information when I used caffe to do my work. I solved this problem by modifying something in the "Makefile.config" file.

The same as the lastest answer, I commented this line "USE_OPENCV := 0" with "#", so after compiling I can use OpenCV's function. I can use this way to deal with it, but you said that when you did this action and got another error. I think you didn't install your OpenCV correctly. Maybe it's your version problem or environment variable error. You can try to install OpneCV again.

Comments

0

I met the same error when I tried to make lmdb.

At first I uncomment "USE_OPENCV:=0" in the Makefile.config and recompile for many times, but it does not help.

So I try to comment "USE_OPENCV:=0" with # and recompile the caffe, it success.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.