本教程安装caffe的前提是在已安装好cuda8.0和cuddn5.0的基础上安装caffe,安装cuda8.0和安装cudnn5.0的教程见本博客其他博文~~安装caffe环境如下~~~~
1.安装依赖的库
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
2.安装其余依赖
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
3.安装git,拉取源码
apt-get install git
git clone https://github.com/BVLC/caffe.git
4.再转到caffe的python目录,安装scipy
cd caffe/python
sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
5.安装python的pip和easy_install,方便安装软件包
wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
python ez_setup.py --insecure
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
6.安装MKL或者Atlas,我装的Atlas
安装命令
sudo apt-get install libatlas-base-dev
7.安装python依赖(路径根据自己的目录可能要调一下)
cd caffe/python
执行 su root
转到root用户执行
for req in $(cat requirements.txt); do pip install $req; done8.编辑caffe所需的Makefile文件
cd caffecp Makefile.config.example Makefile.config
vim Makefile.config
取消对# USE_CUDNN := 1的注释 #为了启用cudnn加速
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 19.编译caffe
make -j4测试一下编译结果
make test
make runtest
10.编译pycaffe
make pycaffe -j4