Centos下Caffe环境搭建

网上各路大神的配置很繁琐 其实官网

http://caffe.berkeleyvision.org/installation.html的配置和安装步骤很简单 而且针对了不同环境 所以我建议大家不要按照xx的blog来,做个参考可以(包括我的大笑) 。遇到错误的时候再Google,避免走弯路。


首先更新yum源

cd /etc/yum.repos.d/

mv CentOS-Base.repo CentOS-Base.repo_bak

wget http://mirrors.163.com/.help/CentOS7-Base-163.repo

wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

yum clean all

yum makecache













按照官网的安装依赖库

sudo yum install protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel


sudo yum install gflags-devel glog-devel lmdb-devel



yum install atlas-devel


yum install python-devel


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


然后就是编译,按照官网步骤(-j8是用多线程,加快速度):

cp Makefile.config.example Makefile.config
# Adjust Makefile.config (for example, if using Anaconda Python, or if cuDNN is desired)
make all -j8
make test
make runtest


在编译过程中有可能会出现cblas和atlas两个库找不到的错误,更改Makefile.config文件,解决方案如下:



OK,安装完毕,我相信对绝大对数人而言比较复杂的步骤是CUDA安装,但是这步我已经很熟练了,而且我们的CUDA早就配置好了。




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章