caffe服务器搭建血泪记录

装过很多次caffe了,但这个还是遇到了很多奇葩问题,不过以前都是在ubuntu上,这次是在centos上。

1、import error _caffe.so: undefined symbol: _ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE boost_python版本不匹配,我用的python3,因此需要的是libboost_python3需要重新编译boost

2、编译boost

  https://blog.csdn.net/bodybo/article/details/79962814

  将编译出的libboost_python3.so和libboost_python3.a拷贝到/usr/lib64(绝大部分系统有的是/usr/lib/)

3、.skipped <pstage/lib>libboost_python3.so.1.65.1

死活编译不出libboost_python3,一直跳过,通过locate pyconfig.h,多试几个路径

4、找不到skimage.io模块”

pip install scikit-image --upgrade --user

5、 return _message.default_pool.AddSerializedFile(serialized_pb) TypeError: expected bytes, str found

编译生成的caffe_pb2.py有问题 ,用生成好的去替换自己的,我用的是https://blog.csdn.net/qq_33144323/article/details/81280831

6、升级gcc

有的错误是gcc版本过低造成的,通过指令升级即可。

https://blog.csdn.net/ysx_cpp/article/details/77187453

7、/usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found

https://blog.csdn.net/u012811841/article/details/77854581

8、找不到cuda*.h

通过which nvcc看nvcc当前路径,正常应该在cuda,但出来的却是在/usr/lib/bin下

终端输入:

export PATH="/usr/local/cuda-9.0/bin:$PATH"

export LD_LIBRARY_PATH="/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH"

9、error: ‘PyThreadState’ has no member named ‘exc_traceback’

python3.7与cython兼容性有点问题,切换到python3.5。。。。

10、安装mmdetection遇到问题: undefined symbol: __cudaPopCallConfiguration

之前安装的是cuda9.2,坑很多,切回9.0

cuda cudnn历史版本下载:https://blog.csdn.net/qq_33485434/article/details/85242970

卸载之前的版本:https://blog.csdn.net/wanzhen4330/article/details/81704474

11、matlab服务器安装与caffe编译

https://blog.csdn.net/zziahgf/article/details/78054204

  https://blog.csdn.net/tomato_ljl/article/details/79169028

12、编译matlab接口遇到问题

libharfbuzz.so.0: undefined symbol: FT_Get_Advance

https://github.com/kyamagu/mexopencv/issues/74

   在终端运行matlab时,有时候会找不到,给出路径:export PATH=/usr/local/MATLAB/R2014a/bin:$PATH

13、/usr/bin/ld: /tmp/ccA5JGRP.o: undefined reference to symbol ‘_ZN2cv6String10deallocateEv‘

  删掉自带的opencv:yum remove opencv make uninstall

14、/usr/bin/ld: cannotfind-lcblas/usr/bin/ld: cannotfind-latlas

修改makefile.config

BLAS := atlas

修改后

BLAS :=open

15、fatal error: pyconfig.h: No such file or dir

  export CPLUS_INCLUDE_PATH=/你的anconda路径/include/python2.7

16、/libopencv_core.so.3.4: could not read symbols: Invalid operation

  这一类问题通常是缺少软连接,参考 https://blog.csdn.net/qq_39436605/article/details/80893885

漫漫折腾之路。。。。。