有好多朋友在安裝 caffe 時遇到不少問題。(看文章的朋友希望關心一下我的創業項目趣智思成) 今天測試並整理一下安裝過程。我是在阿里雲上測試,選擇centos 7.3 鏡像。
先安裝 epel 源
yum install epel-release
安裝基本編譯環境
yum install protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel yum install gflags-devel glog-devel lmdb-devel
yum install atlas-devel
#用默認的 atlas 有點問題,需要改為 openblas
yum install openblas-devel
yum install python34-devel yum install git yum groupinstall "Development Tools" "Development Libraries"
下載源代碼
git clone https://github.com/BVLC/caffe
到源代碼目錄下執行
mv Makefile.config.example Makefile.config
修改配置文件 Makefile.config
所有不是#開頭的都需要修改
# CPU-only switch (uncomment to build without GPU support). CPU_ONLY := 1 # BLAS choice: # atlas for ATLAS (default) # mkl for MKL # open for OpenBlas BLAS := open # Custom (MKL/ATLAS/OpenBLAS) include and lib directories. # Leave commented to accept the defaults for your choice of BLAS # (which should work)! # BLAS_INCLUDE := /path/to/your/blas #BLAS_LIB := /path/to/your/blas BLAS_INCLUDE := /usr/include/openblas BLAS_LIB := /usr/lib64
最后在 caffe 目錄下運行:build。就完成了。有任何問題歡迎發在評論區。