编译caffe时报错
.build_release/lib/libcaffe.so: undefined reference to cv::imread(cv::String const&, int)’
报错原因:
caffe默认使用opencv2.X版本,但是我的机器上安装的是opencv 3.2.0
可能的解决方法包括:
1. Makefile.config中pkg-config --modversion opencv
取消注释(亲测可用)
2. Makefile.config中OPENCV_VERSION := 3
取消注释(亲测可用)
3. Makefile.config中找到LIBRARIES(在PYTHON_LIBRARIES := boost_python python2.7 前一行)并修改为:
LIBRARIES += glog gflags protobuf leveldb snappy \
lmdb boost_system hdf5_hl hdf5 m \
opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs
(未测试)