Caffe Installation Guide

Refer to caffe official installation guide. I skipped some steps because I already have cuda installed from tensorflow installation guide. Thus, the first step for me is to install dependencies, followed by download caffe, install python dependencies, etc. everything works fine until compile caffe, after typing make all. There are some errors come out related to opencv.

CXX/LD -o .build_release/tools/convert_imageset.bin
.build_release/lib/ undefined reference to cv::imread(cv::String const&, int)' .build_release/lib/ undefined reference tocv::imencode(cv::String const&, cv::_InputArray const&, std::vector >&, std::vector > const&)'
.build_release/lib/ undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/convert_imageset.bin] Error 1

I found the solution here.

add "opencv_imgcodecs" in Makefile.(LIBRARIES += glog gflags protobuf leveldb snappy \
lmdb boost_system hdf5_hl hdf5 m \
opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs)
If you input "make all",the problem is the same again.But if you delete all the file in build(rm -rf ./build/*) before "make all",you will success.I just success

Following sources are also very useful. I recommend read them before installation:

Second Annual Data Science Bowl Deep Learning Tutorial


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s