Learn about the Caffe installation and record the installation process. Resources:
1.caffe official website http://caffe.berkeleyvision.org/
2.caffe git tutorial Https://github.com/BVLC/caffe
3. Denny Study notes Http://www.cnblogs.com/denny402/p/5067265.html
4. Caffe Environment Construction http://blog.csdn.net/hjimce/article/details/48781693
5. http://blog.csdn.net/liuxiabing150/article/details/42503389
First, version
Linux system: Ubuntu 14.04 (64-bit)
Reserve enough memory, or there will be a memory overflow problem. Before the virtual machine left only 2G of memory, obviously not enough, and adjusted the memory size reconfiguration.
Second, start the installation
1, because the PC graphics card is not satisfied with the operation, eliminating the installation Cuda, install no GPU version.
2, installation Caffe
Download Caffe First
# sudo git clone https://github.com/BVLC/caffe.git
Then install a bunch of third-party libraries
#sudo apt-get install Libatlas-base-dev#sudo apt-get install Libprotobuf-dev# sudo apt-get install libleveldb-dev# sudo apt-get install libsnappy-dev# sudo apt-get Install Libopencv-dev# sudo apt-get install Libboost-all-dev# sudo apt-get install Libhdf5-serial-dev# sudo apt-get install Libgflags-dev # sudo apt-get install Libgoogle-glog-dev# sudo apt-get install liblmdb-dev# sudo apt-get install protobuf-compiler
Next, install the OPENCV. The first time the installation encounters a memory overflow problem, after expanding the memory, the problem is avoided
# CD Caffe# sudo git clone https://github.com/jayrambhia/Install-OpenCV# CD Install-opencv/ubuntu # sudo sh dependencies.sh# CD 2.4# sudo sh opencv2_4_10.sh
Next, compile the caffe.
# CD Caffe# sudo cp Makefile.config.example makefile.config
Because there is no GPU version installed, you need to modify the makefile.config. The contents of the file are as follows:
Then we put: #CPU_ONLY: = 1, the comment symbol of the line is removed: cpu_only:=1. When modified, execute the following statement:
# sudo vi/etc/makefile.config
Notice how the VI command is used, (: WQ) to save the exit.
When the above settings are complete, start compiling:
# make all-j4 # make Test #
Note:-j4 refers to the use of several threads at the same time to compile, can speed up, j after the number can be based on the number of CPU core to determine, if the CPU is 4 cores, the parameter is-J4, you can not add this parameter, directly use "make all", so the speed may be a bit slower.
The compilation encountered an error "Caffe/proto/caffe.pb.h:no such file or directory", executing the following statement:
# Protoc Src/caffe/proto/caffe.proto--cpp_out=. # mkdir Include/caffe/proto
At this point, the Caffe installation is complete.
3. Test Caffe
Download Mnist data
# CD Caffe# sudo sh data/mnist/get_mnist.sh# sudo sh examples/mnist/create_mnist.sh
At run time, there is no GPU, you need to modify the configuration file Lenet_solver.prototxt
# sudo vi examples/mnist/lenet_solver.prototxt
Change the last line's Solver_mode:gpu to Solver_mode:cpu
Once configured, you are ready to run the
# sudo sh examples/mnist/train_lenet.sh
Note that when you run the Caffe program, you must be in the root directory of the Caffe, or you will get an error.
Installation Configuration Ubuntu14.04+caffe