Caffe:opencv错误

use*_*108 6 c++ opencv python-3.x opencv3.0 caffe

我从源代码构建了opencv 3.0,并且可以运行一些示例应用程序,根据标题构建,所以我认为它已成功安装.

我也在使用python3,现在我去安装和构建caffe.由于拥有AMD GPU和Anaconda,我在Makefile.config中设置了一些变量,因为我正在使用CPU.

当我运行make all时,我收到此错误:

$ make all
CXX/LD -o .build_release/examples/cpp_classification/classification.bin
/usr/bin/ld: .build_release/examples/cpp_classification/classification.o: undefined reference to symbol '_ZN2cv6imreadERKNS_6StringEi'
//usr/local/lib/libopencv_imgcodecs.so.3.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:565: recipe for target '.build_release/examples/cpp_classification/classification.bin' failed
make: *** [.build_release/examples/cpp_classification/classification.bin] Error 1
Run Code Online (Sandbox Code Playgroud)

从搜索我认为这与使用openCV 3有关,但我不知道从哪里开始寻找解决方案.有帮助吗?

是的,我是那些希望摆弄Google Inception学习技术的无经验用户之一.

Jon*_*Jon 14

你也可以opencv_imgcodecs在第187行添加到MakeFile ,看看这个拉动.

  • 添加`-lopencv_imgcodecs`非常适合我的g ++编译。 (2认同)

MZH*_*ZHm 8

可能是您正在使用OpenCV版本3.如果是,只需取消注释以下行Makefile.config:

# OPENCV_VERSION := 3
Run Code Online (Sandbox Code Playgroud)

所以它看起来像

OPENCV_VERSION := 3
Run Code Online (Sandbox Code Playgroud)

您可以执行以下操作来验证当前使用的版本:

$ python
>>> import cv2
>>> cv2.__version__
'3.1.0-dev'
Run Code Online (Sandbox Code Playgroud)


use*_*108 1

我使用了cmakeflag-DBUILD_TIFF=ON并获得了成功的构建。