About the installation procedure of Caffe. The one I wrote before was quite subtle, so I rewrote it. (I'm just Chainer and I don't use Caffe.) Previous one: Install Caffe on Ubuntu 14.04 (CPU mode)
I tried it on ubuntu 14.04. Well, it's the same as the official website. I will write a memo.
#Install the latest version
$ wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
$ sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
$ sudo apt-get update
$ sudo apt-get install cuda
cuDNN It seems that it will be faster if cuDNN is introduced. (Nvidia Developer registration required) You don't have to put it in.
#Register and download from your browser
$ tar xvf cudnn-7.5-linux-x64-v5.0-rc-tgz
$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include
$ sudo cp cuda/lib64/* /usr/local/cuda/lib64
$ sudo apt-get install libatlas-base-dev libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
#If git is not included
$ sudo apt-get install git
#Place it directly under home. If you understand, please go wherever you like.
$ cd
$ git clone https://github.com/BVLC/caffe.git
If you don't use cudnn, you can leave it as it is
$ cd caffe
$ cp Makefile.config.example Makefile.config
Uncomment line 5 if you use cnDNN
Makefile.config
# USE_CUDNN := 1
↓
USE_CUDNN := 1
Parallel processing can be done by doing $ make -j4 all
. The number is the number of CPU cores.
It takes time, so it is recommended to do it with full power.
$ make all
$ make test
$ make runtest
If all the tests pass, the caffe environment construction is complete.
If it fails, fix the problem, then do $ make clean
and start over with $ make all
.
python system
$ sudo apt-get install python-dev python-pip python-numpy python-skimage gfortran
Install required libraries with pip
$ sudo pip install -r ~/caffe/python/requirements.txt
compile
$ make pycaffe
Pass through. (Bash example)
$ echo 'export PYTHONPATH=~/caffe/python/:$PYTHONPATH' >> ~/.bashrc
#To reflect
$ source ~/.bashrc
later
$ python
>>> import caffe
OK if caffe is loaded with.
Recommended Posts