Linux (Ubuntu) Caffe compiler installation __linux

Source: Internet
Author: User
Tags image processing library centos git clone
0. About Caffe (by@ cold sunny Little)

Caffe is a widely used framework for depth learning in the Image field, and its model zoo has a large number of predefined models available for use. Image-related applications are heavily used to Caffe.

Wall crack recommends that you use the Linux system for the following reasons. Linux system (most companies for CentOS or Ubuntu), is the actual development of the system used in advance, familiar with the command line, for practical applications and development are necessary. In contrast to Windows, the dependency pack installation is very simple in Linux. There are often a number of problems with compiling windows, and there are very few solutions to caffe problems under Windows online. A large number of two development and extensions are only Linux versions. 1. Notes

The following is the installation of Caffe some of the notes, write is not clear, welcome to the Community Post asked, but also convenient for more students to see the same problem ^_^ 2. About the system

This description is about the Linux system, preferably CentOS more than 7.0, or Ubuntu 14.04 or more
Because the lower version of the installation is not compatible with the appropriate BOOST,OPENCV and other libraries 3. Install dependent libraries

To be sure, all of the libraries are loaded, or they may not be available for compilation.
Where protobuf is used to define layers, LEVELDB is the database to store picture data during training, OPENCV is the image processing library, boost is the common C + + library, etc.

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 4. Install part of the library required for scientific computing and Python

sudo apt-get install openblas-dev numpy scipy matplotlib lapack-dev freetype-dev libpng-dev openblas-dev 5. Install the remaining dependencies

sudo apt-get install Libgflags-dev libgoogle-glog-dev liblmdb-dev 6. Install git, pull source

Apt-get Install git

git clone https://github.com/BVLC/caffe.git 7. Install python pip and Easy_install for easy installation of packages

wget--no-check-certificate https://bootstrap.pypa.io/ez_setup.py
Python ez_setup.py--insecure

wget https://bootstrap.pypa.io/get-pip.py

Python get-pip.py 8. Install Python dependencies (path may need to be tuned according to your own directory)

CD Caffe/python

Perform
For req in $ (cat requirements.txt); do pip install $req; Done

This step is a bit slow to install, don't worry, wait, go ahead and do something else ^_^ 9. Makefile files required to edit Caffe

CD Caffe
CP Makefile.config.example Makefile.config
Vim Makefile.config
Makefile.config there is a dependent library of the path, and a variety of compiler configuration, if there is no GPU, you can refer to my following to help you change the configuration file content:

# # Refer to Http://caffe.berkeleyvision.org/installation.html # contributions simplifying and improving we build system are welcome! # CUDNN Acceleration Switch (uncomment to build with CUDNN). # Use_cudnn: = 1 # cpu-only switch (uncomment to build without GPU support). Cpu_only: = 1 # Uncomment to disable IO dependencies and corresponding data layers # Use_opencv: = 0 # Use_leveldb: = 0 # Use_lmdb: = 0 # Uncomment to allow Mdb_nolock when reading Lmdb files (only if necessary) # Your should not set this flag I f you'll be reading Lmdbs with any # possibility of simultaneous read and write # Allow_lmdb_nolock: = 1 # Uncomment if You are using OpenCV 3 # Opencv_version: = 3 # To customize your choice of compiler, uncomment and set the following. # N.B. The default for Linux are g++ and the default for OS X is clang++ # custom_cxx: = g++ # CUDA directory contains bin/ and lib/directories that we need. Cuda_dir: =/usr/local/cuda # on Ubuntu 14.04, if CUDA tools are installed via # "sudoApt-get Install Nvidia-cuda-toolkit "then use this instead: # Cuda_dir: =/usr # cuda architecture and all of them. # for CUDA < 6.0, comment the *_50 lines for compatibility. Cuda_arch: =-gencode arch=compute_20,code=sm_20 \-gencode arch=compute_20,code=sm_21 \-gencode arch=compute_30,code= sm_30 \-gencode arch=compute_35,code=sm_35 \-gencode arch=compute_50,code=sm_50 \-gencode arch=compute_50,code= COMPUTE_50 # BLAS Choice: # Atlas for Atlas (default) # MKL for MKL # Open for Openblas #BLAS: = Atlas BLAS: = open # Cust The OM (Mkl/atlas/openblas) include and Lib directories. # Leave commented to accept ' defaults for your choice of BLAS # (which should)! # blas_include: =/path/to/your/blas # Blas_lib: =/path/to/your/blas # Homebrew puts Openblas in a directory ' not ' On the standard search path # Blas_include: = $ (Shell brew--prefix Openblas)/include

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.