ubuntu166.04 Installation of Caffe

Source: Internet
Author: User
Tags git clone

Write in front: Before has been engaged in Keras, recently due to some needs, need to learn Caffe, this record Caffe installation record. The Cuda is already installed by default

If you are migrating from another deep learning platform to Caffe, follow this tutorial.

First step: Git clone https://github.com/BVLC/caffe.git, then install the following pair of dependent files.

Apt-get Install Libatlas-base-dev libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev Libboost-all-dev Libhdf5-serial-dev Libgflags-dev Libgoogle-glog-dev Liblmdb-dev Protobuf-compiler

The second step, to install OPENCV, I do not know why to install, do not install is not, note, be sure to enter into the Caffe directory below.

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

The third step, if you install the CUDNN, then do not rush to compile, modify the makefile file so that you can use CUDNN acceleration

sudo vi makefile.config
The comment symbol # of the USE_CUDNN line is removed, i.e. use_cudnn: = 1, about the 5th line, and can be looked up when using Vim.

Fourth step, compile, but here may encounter a small problem, that is "fatal error:hdf5.h", the solution is as follows

1: In the Makefile.config file, add /usr/include/hdf5/serial/ to Include_dirs, that is, the following first line of code is changed to the second line of code.

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

2: In the makefile file, change hdf5_hl and Hdf5 to hdf5_serial_hl and hdf5_serial, that is, the following first line of code is changed to the second line of code.

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial
接下来就可以正常编译了

CD ~/caffe
sudo cp Makefile.config.example Makefile.config
Make all

So that's it, enter echo $ on the command line? If the return is 0, then the compilation is successful, and the next step is to test a small example.

ubuntu166.04 Installation of Caffe

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.