Caffe Study Notes (1) Install-Ubuntu 15.04

Source: Internet
Author: User
Tags gz file

Official Installation Manual

Remark: Using the system-Ubuntu 15.04 64-bit operating system (if the system is on a virtual machine, Ubuntu will not be able to enter the GUI after Cuda is installed)

/**************************************************/

Preparatory work: Cuda,openblas,boost, PROTOBUF,OPENCV, Python

/**************************************************/

Method One:

Install Caffe Official Manual on Ubuntu system (the artifact was not seen on the first installation ...). )

0. Basic dependencies

$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

1. CUDA (using method two installation)

2. BLAS

If you choose to use Atlas: $sudo apt-get install Libatlas-base-dev

If you choose to use Openblas (the effect is better) then refer to the method two installation;

3. Python (optional)

If you need to use Python, $sudo apt-get install Python-dev python header file for Pycaffe interface;

+ The Python installation in method two;

4. Remaining dependencies (14.04 and above)

$sudo apt-get Install Libgflags-dev Libgoogle-glog-dev Liblmdb-dev

Method Two: (Because the system space problem failed ...) )

0. CUDA-is a general-purpose parallel computing architecture introduced by NVIDIA that enables the GPU to solve complex computational problems

Download

0.1 Selecting the operating system and installation type

Installation of the 0.2 Deb (network) method

Download the software shown in Ubuntu;

Execute the following 3 lines of command;

1. Openblas-Base linear algebra sub-Library with a large number of programmed programs for linear algebra operations

Download

1.1 download. zip/. tar.gz file, unzip;

1.2 Installation commands

$sudo make

$sudo make prefix=/path/to/your/installation Install

[1.3 Put the generated. So library file into the system/lib folder] (optional step);

2. Boost Library-an extended C + + library for the C + + language

Download

Method One: (failed)

2.1 Download boost_1_60_0.tar.gz file, unzip;

2.2 Installation Commands

Execute $sudo./bootstrap.sh compile successfully;

Execute $sudo./bjam starts compiling, approximately more than 10 minutes, and appears after compilation: the Boost C + + Libraries were successfully built!

Method Two:

Execute the command directly:

$apt-cache Search boost: Searching for all boost libraries

$sudo apt-get Install Libboost-all-dev: Installing the appropriate libraries

2.3 Test Code: Convert a string to an integer using the Boost library

 1  #include <iostream>2  # Include<boost/lexical_cast.hpp>3  int   main ()  4  { int  a = Boost::lexical_cast<int  > ( 123456   "  6  std::cout << a <<STD::ENDL;  7  return  0   8 } 

3. A data Interchange format for protobuf -Protocol Buffer:google

Method One: Install according to the source code (failure)

Download

3.1 download, and unzip;

3.2 Installation Commands

Installation Guide under C + +

Install the build tool $sudo Apt-get install autoconf automake Libtool Curl

Execute $./autogen.sh generate Configure script;

Failure not resolved:

Hint-Google Mock not present. Fetching gmock-1.7.0 from the web ... Not successful

FIX: Do I need to install Google Mock? Google Mock Installation Guide

To start compiling:

$./configure

$make

$make Check

$sudo make Install

$sudo Ldconfig # Refresh shared library cache.

Method Two: (Success)

sudo apt-get install Protobuf-compiler

4. OpenCV (Installation time is longer)

Using automatic script installation (script address)

Ubuntu Execution:

$CD Ubuntu

$chmod +x *

$./opencv_latest.sh

5. Python (Installation time is longer)

Python is installed by default in Ubuntu;

Perform the $sudo apt-get install PYTHON-PIP installation pip (a Python installation and Management Extension Library tool);

Download Caffe, unzip, and then go to the Python folder and execute $ for req in $ (requirements.txt); do pip install $req; Done operation, installing the dependencies on Python in Caffe;

/*****************************/

Installing Caffe

/****************************/

Download

The key is to properly configure the Makefile.config file:

CP Makefile.config.example Makefile.config

Modify the configuration as appropriate:

Cuda_dir;

Blas:=open; (using Openblas)

The corresponding parameters are commented out without using the Python interface;

Include_dirs and Library_dirs need to add all the header files and Library directory folder address required Caffe;

After the configuration is complete, execute the command: (CMake is used in this part of the operation)

$make All-Compile the library file that generated Caffe _caffe.so

$make Test

$make Runtest

Caffe Study Notes (1) Install-Ubuntu 15.04

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.