Caffe Installation Guide

Source: Internet
Author: User

In fact, the installation on caffe has been clearly introduced, and there are also many articles about Caffe. The reason for writing this article is that this is a Chinese version, in addition, I encountered many problems when installing the lab server. I think people may encounter problems later, so I posted them.


Caffe Installation Guide for Linux

1. System and permissions

Applicable platforms include Ubuntu 14.04, UBUNTU 12.04, OSX 10.9, and OS X 10.8. You must obtain the root permission for installation.

2. Dependent Libraries

A) Cuda 6.5 (recommended), 6.0, 5.5, 5.0 and the corresponding Cuda driver-cuda6.0 has been installed on the laboratory server:Cuda_dir: =/usr/local/cuda-6.0

B) choose one of the three Blas (Atlas, MKL, openblas) brackets-Atlas has been installed in the lab:Atlas: =/usr/lib64/Atlas

C) The following installation commands of opencv do not need to be configured.

D) there will be corresponding installation commands under Boost, without the need to configure the path.

E) The following installation commands are available under glog, gflags, protobuf, leveldb, snappy, hdf5, and lmdb. protobuf may need to modify the environment variable for installation.

F) Python (Python 2.7, numpy (> = 1.7) boost. python. If you do not need visualization, Python does not need to be concerned. Although the path of Python must be provided in the configuration file of makefile-Python has been installed in the lab, numpy: python_include: =/usr/local/include/python2.7 \/usr/local/lib/python2.7/Site-packages/numpy/CORE/include/numpy

G) MATLAB: It is useless. The Internet aimed at a sentence that can be combined with Matlab with hdf5.

H) cudnn caffe is a CNN computing module provided by nvdia. The performance is said to be the best, but it is not significantly improved. We will not describe how to use it here. (It is troublesome to apply to nvdia. I don't know if it will be available later)

 

This document does not describe how to use CPU computing.

3. Install the dependent Library

A) skip cuda, Blas, Python, and Matlab configurations. Note that, in the Caffe source code, makefile. config. example, you mustChange Blas: = to Atlas: =

B) other dependent libraries. The system of the laboratory server is centos, So enter the following command to install protobuf, leveldb, snappy, opencv, boost, hdf5 at one time.

 

Sudo Yum install protobuf-develleveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel

 

However, it should be noted that an error occurs because the server reports an error when accessing the downloaded package of the dependent libraries above (I do not know whether it is blocked or because the platform resource location is adjusted). The error message is as follows:

No package protobuf-devel available.

Error: nothing to do

So it is best to install them one by one to observe which dependent libraries cannot be correctly installed.The dependency libraries that can be directly installed include snappy, opencv, and boost. You need to install protobuf, leveldb, and hdf5 using other methods.

Protobuf:Download protobuf, make, and then modify the environment variable. The corresponding compilation error keyword is Proto-C.

Hdf5:You can download the RPM installation package online.

Leveldb:There are many downloads, but the installation is very sad. For installation instructions, referCorresponding. O to/usr/local/bin

4. Compile

A) modify the path of the dependent library in the makefile. config. Example file, including Cuda And Blas.(To be renamed to Atlas), Python

B) Run cpmakefile. config. Example makefile. config.

C) execute make all & make test.

 

Problems encountered during compilation: libstdc ++. so.6 reported an error. I re-installed the libstdc ++. so.6 library. It is reasonable that people later will not encounter this problem.

5. Test the mnist Database

The demo of the mnist database is very interesting. You can use the instructions in the tutorial to download the dataset and the result.The file name is garbledYou have to modify the file name. For the file name to be modified, refer to the examples/mnist/create_mnist.sh script. Then, two folders will appear under examples/mnist, with the training set and test set respectively, run sh train_mnist.sh.


Caffe Installation Guide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.