ubuntu16+anaconda+caffe+cuda+cudnn的环境安装

最近在做ubuntu16环境下caffe的安装:

caffe官方安装文档:http://caffe.berkeleyvision.org/installation.html

darkknightzh的博客http://www.cnblogs.com/darkknightzh/p/5797526.html

安装caffe之前,建议现安装个Anaconda,caffe支持python2.7和python3.3+建议直接安装Anaconda3。这里有一篇教程怎么安装Anaconda,cuda,cudnn:https://blog.csdn.net/Leona_xz/article/details/89218673

下载caffe:

git clone --recursive https://github.com/BVLC/caffe

安装依赖:

依赖库:protobuf, glog, gflags, hdf5,lmdb。安装:

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 libgflags-dev

sudo apt-get install libgoogle-glog-dev

sudo apt-get install liblmdb-dev

BLAS可以使用atlas,mkl或者openblas。atlas是caffe默认选择的。mkl和openblas性能更好。安装atlas:
sudo apt-get install libatlas-base-dev

安装caffe时遇到:

1). can not find XXXX

这种类似问题一般是找不到安装的库,这个时候需要找到库所在,修改Makefile.config:

-INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
-LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
+INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
+LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/

2)make: *** [.build_release/tools/upgrade_net_proto_binary.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to `__cudaPushCallConfiguration'
.build_release/lib/libcaffe.so: undefined reference to `__cudaPopCallConfiguration'
collect2: error: ld returned 1 exit status

应该是cuda版本跟caffe不兼容的问题https://github.com/jwyang/faster-rcnn.pytorch/issues/190,我用的cuda10,degrade cuda版本应该可以,但因为我还在作其他训练,接下来的安装先不做了,等后期安装再更新。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值