Caffe,来自伯克利的深度学习框架。本文记录和整理了一下其在CentOS 6.7下的编译安装过程,因其依赖比较多,且大多需要手工编译安装,期间遇到较多编译失败,特整理下来供有需要的人参考,少走一些弯路。

环境:CentOS release 6.7 (Final),Python 2.7

1. Prerequisites

Caffe has several dependencies:

  ● CUDA is required for GPU mode.(CUDA for GPU,暂时没用GPU

      ○ library version 7+ and the latest driver version are recommended, but 6.* is fine too

      ○ 5.5, and 5.0 are compatible but considered legacy

  ● BLAS via ATLAS, MKL, or OpenBLAS.

  ● Boost >= 1.55(!!不要使用yum安装,yum安装的 boost-1.41 版本过低!!

  ● protobuf, glog, gflags, hdf5(!!前三个同样不要使用yum安装,版本过低!!

Optional dependencies:

  ● OpenCV >= 2.4 including 3.0(!! yum安装的版本是2.0,也不够!!

  ● IO libraries: lmdb, leveldb (note: leveldb requires snappy)

  ● cuDNN for GPU acceleration (v5)

Pycaffe and Matcaffe interfaces have their own natural needs.

  ● For Python Caffe: Python 2.7 or Python 3.3+, numpy (>= 1.7), boost-provided boost.python

  ● For MATLAB Caffe: MATLAB with the mex compiler.

1.1 General dependencies

1.1.1 下面这些包可以使用 yum 安装:
$ sudo  yum install  cmake leveldb-devel snappy-devel hdf5-devel lmdb-devel

1.1.2 yum安装Python 2.7 

我们主要使用Python Caffe,所以需要先安装Python 2.7

$ sudo  yum install python27 python27-devel

注意安装完并没有替换系统默认的python 2.6,最好也不要替换,因为 yum 本身需要python 2.6:

- 阅读剩余部分 -