Ubuntu16.04+CUDA9.0+CUDNNv7.1+opencv3.4.0+anaconda3+Matlab 2017a+caffe installation

Ubuntu16.04+CUDA9.0+CUDNNv7.1+opencv3.4.0+anaconda3+Matlab 2017a related installation See the previous blog for configuration.

Next, go directly to the installation and configuration of caffe.

General dependencies

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
  • and download caffe Git directly from github Source:
git clone https://github.com/BVLC/caffe.git
  • Enter the corresponding directory:
cd caffe
  • Execute the installation instructions:
cp Makefile.config.example Makefile.config # Copy an installation configuration file 

and then modify Makefile.config file, open the file in the caffe directory:

sudo gedit Makefile.config

Modify the Makefile.config file content:

1. Application cudnn


#USE_CUDNN := 1
changed to: 
USE_CUDNN := 1

2. Application opencv version


#OPENCV_VERSION := 3
change into: 
OPENCV_VERSION := 3

3. Modify cuda path


#WITH_PYTHON_LAYER := 1
change into 
WITH_PYTHON_LAYER := 1

3. Using the python interface


#WITH_PYTHON_LAYER := 1
change into 
WITH_PYTHON_LAYER := 1

4.Modify the python path

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
change into: 
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-g