■官网指引:http://caffe.berkeleyvision.org/install_apt.html
第一部分: 安装dependencies
https://www.linuxidc.com/Linux/2016-09/135034.htm
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libhdf5-serial-dev
PYTHON需要2.7版本,这是操作系统本身已经安装好的. 输入python2.7 --version 会显示具体的版本号说明安装了.
但是还需要sudo apt-get install python-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
然后把CAFFE的源代码下载下来:caffe-master.zip(当然没有安装GIT的得先安装一下)
下载完成之后,进入CAFFE文件夹, 进入里面的PYTHON文件夹,然后输入
for req in $(cat requirements.txt); do pip install $req; done
(PIP如果没有安装得先安装一下:sudo apt install python-pip)
第三步:安装opencv
■(1):安装源码前先安装好需要的第三方环境
■[compiler] sudo apt-get install build-essential
■[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
■[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
执行cmake要在普通用户加sudo进行cmake.
make 和make install也一样
两个问题(1)执行g++ -o 的时候需要加库。
(2)现make中opencv高低版本冲突的问题
/usr/bin/ld: warning: libopencv_core.so.3.1, needed by
//usr/local/lib/libopencv_imgcodecs.so, may conflict with
libopencv_core.so.2.4
/usr/bin/ld: /tmp/ccDhjMld.o: undefined reference to symbol '_ZN2cv6String10deallocateEv'
//usr/local/lib/libopencv_core.so.3.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
解决方案
sudo apt-get autoremove libopencv-dev
最后开始装 caffe。用CMAKE简单。
在编译Caffe-SSD时候遇到以下问题:
Makefile:570: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
1
方法一:安装依赖库.
sudo apt-get install libopenblas-dev
1
方法二:修改Makefile 文件.
将
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
改为:
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial
---------------------
作者:阿呀么耀
来源:CSDN
原文:https://blog.csdn.net/CAU_Ayao/article/details/84023510
版权声明:本文为博主原创文章,转载请附上博文链接!
出现问题:
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
CXX tools/finetune_net.cpp
CXX/LD -o .build_release/tools/finetune_net.bin
CXX tools/net_speed_benchmark.cpp
CXX/LD -o .build_release/tools/net_speed_benchmark.bin
CXX tools/compute_image_mean.cpp
CXX/LD -o .build_release/tools/compute_image_mean.bin
.build_release/lib/libcaffe.so: undefined reference to `cv::imread(cv::String const&, int)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imencode(cv::String const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `cv::imdecode(cv::_InputArray const&, int)'
collect2: error: ld returned 1 exit status
Makefile:616: recipe for target '.build_release/tools/compute_image_mean.bin' failed
make: *** [.build_release/tools/compute_image_mean.bin] Error 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
解决方法:
Makefile
修改:
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs
编译成功:
---------------------
作者:forest_research
来源:CSDN
原文:https://blog.csdn.net/forest_world/article/details/51371560
版权声明:本文为博主原创文章,转载请附上博文链接!
make:*** [.build_release/tools/extract_features.bin]错误1
解决:
这个可能是权限问题,采用以下指令:
sudo su;
make all ;
make test ;
make runtest ;
make pycaffe;