CPU下的Caffe环境配置
1、依赖包安装
sudo apt-get install git
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 libatlas-base-dev
sudo apt-get install python-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
2、下载caffe源码
git clone https://github.com/bvlc/caffe.git
cd caffe/
mv Makefile.config.example Makefile.config
3、修改Makefile.config
a. # CPU_ONLY := 1 改为 CPU_ONLY := 1
b. # MATLAB_DIR := /usr/local 改为 MATLAB_DIR := /usr/local/MATLAB/R2014a/bin
4、 在Makefile.config文件添加/usr/include/hdf5/serial/ 到 INCLUDE_DIRS,也就是把下面第一行代码改为第二行代码。
a. INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
5、在Makefile文件的第173行,把 hdf5_hl 和hdf5修改为hdf5_serial_hl 和 hdf5_serial,也就是把下面第一行代码改为第二行代码。
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial
6、在caffe目录下的终端,依次输入
make all
make test
make runtest