编译gpu版caffe遇到的问题

1、.build_release/lib/libcaffe.so:对‘gflags::ParseCommandLineFlags(int*, char***, bool)’未定义的引用

解决:

这里继续安装gflags: https://github.com/schuhschuh/gflags/archive/master.zip下载。解压

cd gflags-master
mkdir build && cd build
export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
make 
sudo make install
2、nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).

解决:原因是,Makefile中采用了CUDA的compute capability 2.0和2.1,这是两种计算能力。安装的CUDA版本是8.0,但 从CUDA 8.0开始compute capability 2.0和2.1被弃用了,所以可以将Makefile.config中的-gencode arch=compute_20,code=sm_20 和-gencode arch=compute_20,code=sm_21这两行删除即可。

3、/usr/bin/ld: 找不到 -lopenblas

解决:

首先查看是否安装libopenblas-base 和libopenblas-dev,如果未安装,则命令sudo apt-get install libopenblas-base libopenblas-dev后再次编译,仍有错误查看以下解决方式。

I faced the same problem. Even adding library directory "/opt/OpenBLAS/lib/" to ldconfig cache didn't help (as my libopenblas.so is at "/opt/OpenBLAS/lib/libopenblas.so").

Using cmake helped me. Try this from caffe root directory:

mkdir buildcd buildcmake -DBLAS=open ..make allmake runtest

If you need to use make, add the symlink of libopenblas.so to /usr/lib. I did the following:

ln -s /opt/OpenBLAS/lib/libopenblas.so /usr/lib/libopenblas.so

解决网址:https://stackoverflow.com/questions/32353509/usr-bin-ld-cannot-find-lopenblas-error-in-caffe-compilation

4、test_data_transformer.cpp(.text._ZN5caffe11MakeTempDirEPSs[_ZN5caffe11MakeTempDirEPSs]+0x4a):‘boost::filesystem::detail::temp_directory_path(boost::system::error_code*)’未定义的引用。

解决:按照赵永科《21天实战caffe》第38页安装Boost,如果安装完成后还是出现此类信息,查看caffe目录下Makefile文件里LIBRARIES内容的正确与否,楼主在调试前面的bug时错误把这里改动了,不能缺少boost-system和boost-filesystem。如下:

原来的:#LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5

现在的:LIBRARIES += glog gflags protobuf leveldb snappy lmdb boost_system boost_filesystem hdf5_hl hdf5 m opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs openblas

5、.build_release/tools/caffe: error while loading shared libraries: libopenblas.so.0: cannot open shared object file: No such file or directory
make: *** [runtest] 错误 127

解决:sudo apt-get install libopenblas-dev


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值