Compile Caffe (UBUNTU-15.10-DESKTOP-AMD64, Cuda-free)

Source: Internet
Author: User

Compiling the environment

VMWare Workstation Player

Ubuntu-15.10-desktop-amd64

CPU 4700MQ, allocating 6 cores +4GB memory +80GB HDD to VM

Compile step

The main reference is Caffe official website

Http://caffe.berkeleyvision.org/install_apt.html

1. Install the Basic Package

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

Cuda: Because the video card is 750m, does not support Cuda, will not get

Blas:sudo Apt-get Install Libatlas-base-dev

Python:sudo Apt-get Install Python-dev

Other:sudo apt-get Install Libgflags-dev Libgoogle-glog-dev Liblmdb-dev

2. Download Caffe & Configuration

Go directly to GitHub to download the latest Caffe:https://github.com/bvlc/caffe click on the download Zip button to download caffe-master.zip

Unzip Caffe-master.zip

CD Caffe-master

Http://caffe.berkeleyvision.org/installation.html#compilation, copy and modify Makefile.config files according to the website guidelines

CP Makefile.config.example Makefile.config

Since I don't have a cuda-enabled GPU, I need to

# cpu_only: = 1

This line cancels the comment, indicating that only the CPU is used for the calculation

3. Compiling

Make all
Make Test
Make Runtest

The first two make can add-j6 parameters to multi-threaded compilation, improve efficiency

The last make is run for testing, using multithreading does not improve speed

Problems that you may encounter

When make all, an error occurs and the error message is:

Hdf5.h could not being found

1. sudo apt-get install Libhdf5-dev

2. Modify the Makefile.config file

Include_dirs: = $ (python_include)/usr/local/include /usr/include/hdf5/serial/

3. Add a link relationship

Cd/usr/lib/x86_64-linux-gnu
sudo ln-s libhdf5_serial.so.8.0.2 libhdf5.so
sudo ln-s libhdf5_serial_hl.so.8.0.2 libhdf5_hl.so

Reference from https://github.com/BVLC/caffe/issues/2347

And then recompile to

Compile Caffe (UBUNTU-15.10-DESKTOP-AMD64, Cuda-free)

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.