首先安装以下库或软件
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
其次,下载caffe
git clone https://github.com/bvlc/caffe.git
cd caffe/
mv Makefile.config.example Makefile.config
配置文件
在Makefile.config文件的第85行,添加/usr/include/hdf5/serial/ 到 INCLUDE_DIRS,也就是把下面第一行代码改为第二行代码。
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
改成
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
在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
接着执行
make all
make test
make runtest