先说问题 步骤再后面
源码编译caffe遇到的问题
第一个问题 把注释打开
解决方法
第二种解决方法 把最后两个打开
第二个问题(算例不支持20)
解决方法: 把20 和21两个算力都注释调
第三个问题(库的问题)
解决方法:Makefile.config改下这个
第四个问题
build_release/lib/libcaffe.so: undefined reference to cv::imread(cv::String const&, int)
解决方法 可能的解决方法包括:
Makefile.config中pkg-config --modversion opencv取消注释(亲测可用)
Makefile.config中OPENCV_VERSION := 3取消注释(亲测可用)
Makefile.config改下这个
第五个问题:cannot find -lsnappy
sudo apt-getinstall libhdf5-serial-dev libleveldb-dev libsnappy-dev liblmdb-dev
第六个问题:cannot find -lcblas
sudo apt-get install libatlas-base-dev
第七个问题 undefined reference to `cv::imread(cv::String const&, int)’
I found I installed opencv 3.0. and I change the Makefile.config. It works.
[root@localhost caffe-master]# make runtest
.build_release/tools/caffe
.build_release/tools/caffe: error while loading shared libraries: libhdf5_hl.so.100: cannot open shared object file: No such file or directory
make: *** [runtest] Error 127
再来:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/hdf5-1.10.0/lib
第八个问题: ImportError:caffe.so: undefined symbol: _ZN5caffe4mtx_E
Makefile.config
Uncomment to support layers written in Python (will link against Python libs)
WITH_PYTHON_LAYER := 1
源码编译caffe步骤
1git clone https://github.com/weiliu89/caffe.git
2cd caffe
3cp Makefile.config.example Makefile.config
4 vim Makefile.config
以及 BLAS := atlas
4Makefile不需要改
5 make clean
6 make all -j40
7 make pycaffe
8python(一定要在python2.7下弄这个)
把这个/usr/bin/python 添加到.bashrc中
(base) wangzhihao@ubuntu:~/caffe/build/lib$ find /usr -name libcudart.so.10.0
/usr/local/cuda-10.0/lib64/libcudart.so.10.0
####重新编译caffe 完美
1修改Makefile
添加Hdf5的方法:1 find /usr -name hdf5
爆c++错误解决方法
建议:源码编译的时候 把bashrc里的都注释掉