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早就配置好了。




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