1 Dependent packages required for installation
1.1 Install PROTOBUF, LEVELDB, snappy, OpenCV , HDF5, protobuf compiler and boost:
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
1.2 Install dependencies, the commands below install, gflags, glogs and Atlas:
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
sudo apt-get install Libatlas-base-dev
2 Configuring Python
To execute the command first:
sudo apt-get install python-numpy python-scipy python-matplotlib python-sklearn \
python-skimage Python-protobuf python-leveldb python-networkx python-nose python-pandas python-gflags \ Cython Ipython
After you finish executing the command, you can check to see if the installation was successful. After entering Python return, enter Python shell mode, import import NumPy (other packages, and so on) to check if the NumPy is properly installed and continue without an error.
If you execute the Python code, the File "numpy/coretup.py" appears, line-MB, in Check_types
"Cannot compile ' Python.h '. Perhaps you need to "
Systemerror:cannot compile ' Python.h '. Perhaps you need to install Python-dev|python-devel. "
The reason is that the Python.h file cannot be found, and the dependencies required to install NumPy (including Python.h (in Python-devel)) are: Apt-get BUILD-DEP python-numpy
3 Installation Caffe 3.1 Download Caffe
Caffe Download Address: https://github.com/BVLC/caffe/, after decompression, into its root directory, Caffe given a sample configuration file: Makefile.config.example, we need to copy the Makefile.config file through the command: CP Makefile.config.example Makefile.config
Because we only use the CPU, so we need to Makefile.config file "# cpu_only: = 1", the front of the # number can be removed.
3.2 Compiling Caffe
Enter the Caffe folder root directory, eg:~/usr/caffe$, and do the following:
Make all
Make Pycaffe
Make distribute time a little bit longer ...
3.3 Modifying the environment path
Add the following content to the ~/.BASHRC:
#caffe
Export pythonpath= $PYTHONPATH:/home/' username '/usr/caffe/python
Enter the source ~/.BASHRC for the configuration to take effect.
3.4 Test
ceshi.py:
The Import sys
sys.path.append ("/home/zk/usr/caffe/python") #python the interface path, which is not necessary if you are setting the environment variable.
Import Caffe
Compile ceshi.py Pass, the description is done, you can start the DL tour.