Caffe Beginner Part II: Detailed procedure for installing Caffe (CPU) +matlab2014a+opencv3 on Ubuntu16.04 (pro-Test success, 20180529 update)

Source: Internet
Author: User

This is the second part of the Caffe Beginner series , designed to help more students who are interested in deep learning! The first section can refer to the following address:

Caffe Beginner First: Detailed procedure for installing Caffe (CPU) +python on Ubuntu14.04 (pro-Test success, 20180524 update)

OK, let's start our tutorial!

Objective:

Before the first tutorial published, very popular, it seems that my efforts have not been wasted, after all, I spent a few hours writing blog, thank the students for their support ^_^

Pro-Test Tutorials:

The files to be prepared for this tutorial are: Ubuntu16.04, Opencv3 (necessary), matlab2014a.

(1) Ubuntu16.04 I downloaded the Kylin version, the installation tutorial can refer to the following blog:

78887768

Ubuntu16.04 Direct copy to Thunderbolt can be downloaded:

Http://cdimage.ubuntu.com/ubuntukylin/releases/16.04/release/ubuntukylin-16.04.4-desktop-amd64.iso

(2) Opencv3 installation (necessary), refer to the following blog:

74857467

(3) matlab2014a installation, refer to the following blog:

Https://www.cnblogs.com/nowornever-L/p/5649078.html

At this point, students you should install the above environment, the next step into our exciting moment!

STEP1: Open terminal, enter:

sudo apt-get update

STEP2: Install the necessary dependencies:

sudo apt-get install git sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev Libopencv-dev libhdf5-serial-d EV protobuf-compiler sudo apt-get install build-essential sudo apt-get install--no-install-recommends Libboost-all-dev s Udo Apt-get Install Libatlas-base-dev sudo apt-get install Libgflags-dev libgoogle-glog-dev Liblmdb-dev

STEP3: The official website pulls the source code:

Cdgit Clone Https://github.com/BVLC/caffe.git

Note The third step if the terminal download is too slow, the URL can be

Https://github.com/BVLC/caffe.git

Copy to the browser address bar, then manually click the download Zip package, "Caffe-master.zip", then extract to the home folder, the extracted folder renamed to "Caffe-matlab".

STEP4: The second part of the installation depends on:

sudo apt-get install Libblas-dev liblapack-dev libatlas-base-dev gfortran python-numpy sudo apt-get install python-pip Sud o apt-get install python-numpy python-scipy python-matplotlib python-sklearn sudo apt-get install python-skimage python-h 5py python-protobuf python-leveldb sudo apt-get install python-networkx python-nose python-pandas sudo apt-get install PYT Hon-gflags cython ipython sudo pip install--upgrade matplotlib sudo apt-get update

STEP5: Modify the Makefile.config configuration file:

CD caffe-matlabcp Makefile.config.example Makefile.configsudo gedit makefile.config

Modified 4:

Open "cpu_only" and change it to:

Cpu_only: = 1

Open "opencv_version" and change it to:

Opencv_version: = 3

The MATLAB path is configured, change to;

Matlab_dir: =/usr/local/matlab/r2014a

To configure the include path, change to:

Include_dirs: = $ (python_include)/usr/local/include/usr/include/hdf5/seriallibrary_dirs: = $ (PYTHON_LIB)/usr/local /lib/usr/lib/usr/lib/x86_64-linux-gnu/hdf5/serial

STEP6: Modify the Makefile file:

sudo gedit Makefile

Under Cxxflags + =-MMP-MP Add:

Cxxflags + =-std=c++11

Will:

Nvccflags +=-ccbin=$ (CXX)-xcompiler-fpic $ (common_flags)

To be replaced by:

Nvccflags + =-d_force_inlines-ccbin=$ (CXX)-xcompiler-fpic $ (common_flags)

STEP7: Manually add the environment variable as follows:

Add at the end:

Export path= $PATH:/usr/local/r2014a/binexport ld_library_path=/usr/local/r2014a/sys/os/glnxa64  Export LD_ Preload=/usr/lib/x86_64-linux-gnu/libstdc++.so.6  Export ld_library_path=/usr/lib/x86_64-linux-gnu/:/usr/ local/cuda-8.0/lib64  Export ld_preload=/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4:/usr/lib/x86_64- linux-gnu/libopencv_imgproc.so.2.4:/usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4:/usr/lib/x86_64-linux-gnu/ Libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libfreetype.so.6  

or terminal input directly:

Export path= $PATH:/usr/local/r2014a/binexport ld_library_path=/usr/local/r2014a/sys/os/glnxa64  Export LD_ Preload=/usr/lib/x86_64-linux-gnu/libstdc++.so.6  Export ld_library_path=/usr/lib/x86_64-linux-gnu/:/usr/ local/cuda-8.0/lib64  Export ld_preload=/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4:/usr/lib/x86_64- linux-gnu/libopencv_imgproc.so.2.4:/usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4:/usr/lib/x86_64-linux-gnu/ Libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libfreetype.so.6  

Restart your computer.

STEP8: Compiling and testing:

Make All-j4make Test-j4
Make Runtest-j4make Matcaffe-j4make Distribute
Make Mattest

  

  

Caffe Beginner Part II: Detailed procedure for installing Caffe (CPU) +matlab2014a+opencv3 on Ubuntu16.04 (pro-Test success, 20180529 update)

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.