First, look at your own system, UBUNTU16.04,CPU, no nvidia, no OPENCV
Second, install the dependency package
- Install PROTOBUF,LEVELDB,SNAPPY,OPENCV,HDF5, protobuf compiler andboost:
sudo apt-get install Libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf- Compilersudo apt-get install--no-install-recommends Libboost-all-dev
- Install Gflags,glogs, Lmdb Andatlas.
sudo apt-get install Libgflags-dev libgoogle-glog-dev liblmdb-devsudo apt-get Install libatlas-Base-dev
Third, download Caffe
git clone git://github.com/bvlc/caffe.git
Iv. Compiling Caffe
- Switch to the directory where Caffe is located
CP Makefile.config.example Makefile.config
- Configure Makefile.config
1) Cpu_only: = 1 (just remove the front # on the line)
2) configuration of some reference files (added mainly to solve the new version, HDF5 path problem) (Modify the contents)
Include_dirs: = $ (python_include) /usr/local/INCLUDE /usr/lib/x86_64-linux-gnu/hdf5/ serial/include library_dirs: = $ (python_lib) /usr/local/LIB /usr/lib/usr/ Lib/x86_64-linux-gnu/hdf5/serial
- Make Caffe (8 represents 8 cores. J4 or not add to the line)
Make all---j8
- The compilation succeeds, otherwise execute make clean multiple execution.
V. Compiling the Python interface
The Caffe has a Python\c++\shell interface, which is especially handy in Caffe Python, and has an interface in the instance.
- Make sure PIP is installed
sudo apt-get Install Python-pip
- Go to the Caffe folder, enter the Python folder inside, then enter
for in do pip install $req;
If you're not prompted enough, that's right.
For req in $ (cat requirements.txt); Do sudo pip install $req; Done
- Compiling the Python interface
Make Pycaffe
- Go to the Python folder inside the Caffe folder and record the current path (PWD). Finally open the ~/.BASHRC file and add it to the last line in the file (whatever your root directory is)
Export Pythonpath=/path/to/caffe/python: $PYTHONPATH
Vi.. Test
This time should be able to test: (in the Python directory, otherwise you will be prompted to find Caffe)
$ python2.7Python2.7. A(default, Jul1 ., the: A: -) [GCC5.4.0 20160609] on Linux2type" Help","Copyright","credits"Or"License" forMore information.>>>Import Caffe>>>
Instructions to install all completed!
Seven, error
-import Caffe when the Scikit-image error is displayed, then install the scikit-image just fine. The lack of others on Baidu install other
Pip Install Scikit-image
-Make a clean and make after other errors
"Caffe" Ubuntu16.04 Configuration Installation Caffe (only CPU)