标签:
1.从github上下载源码
git clone https://github.com/BVLC/caffe.git
2.安装BLAS库
选择安装mkl,在官网上下载学生版,解压到存放目录。先对解压后的文件授权
chmod a+x parallel_studio_xe_2015 -R
然后用root权限执行sudo ./install.sh(一般都选择默认的选项)
sudo vim /etc/ld.so.conf.d/intel_mkl.conf
配置环境,加入下面内容/opt/intel/lib/intel64
/opt/intel/mkl/lib/intel64
3.安装python依赖包
先安装python-pip
sudo apt-get install python-pip
然后进入caffe下的python文件夹,执行for req in $(cat requirements.txt); do pip install $req; done
4.安装cmake
sudo add-apt-repository ppa:george-edison55/cmake-3.x
sudo apt-get update
sudo apt-get install cmake
5.安装glog
https://github.com/google/glog.git(这个地址的安装包会报错,下载0.3.3的) 进入文件夹,执行
sudo ./configure
sudo make
sudo make install
6.可以用apt-get安装的
sudo apt-get install libboost-all-dev libprotobuf-dev libsnappy-dev libleveldb-dev libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler libopencv-dev
7.安装cudnn
从官网上下载,然后解压
sudo cp cudnn.h /usr/local/include
sudo cp libcudnn.* /usr/local/lib
复制过去之后,软连接就不见了,要自己再链接一次sudo ln -sf libcudnn.so.7.0.64 libcudnn.so.7.0
sudo ln -sf libcudnn.so.7.0 libcudnn.so
sudo ldconfig
8.安装caffe
执行cp Makefile.config.example Makefile.config,修改部分内容
BLAS := mkl
USE_CUDNN := 1前面注释去掉
DEBUG := 1 //便于后面调试
编译make all -j8
make test -j8
make runtest -j8
错误:
1./bin/bash: aclocal-1.14: command not found
sudo apt-get install autotools-dev
sudo apt-get install automake
2.src/demangle.h:80:27: error: expected initializer before ‘Demangle’.换成版本0.3.3就好了
3./sbin/ldconfig.real: /usr/local/lib/libcudnn.so.7.0 is not a symbolic link.重新建立软链接
标签:
原文地址:http://www.cnblogs.com/shishupeng/p/5726665.html