ubuntu14.04 Installing the Caffe+python interface

Source: Internet
Author: User

1 Ubuntu System Installation

Ubuntu 14.04:http://www.releases.ubuntu.com/14.04/

You can download it directly by clicking the address below

Http://www.releases.ubuntu.com/14.04/ubuntu-14.04.5-desktop-amd64.iso

2 Caffe Environment Installation

General 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
sudo apt-get install Libatlas-base-dev

Python: sudo apt-get install Python-dev python-pip

Ubuntu 14.04:sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

CUDA: Using the cuda7.5 version

sudo dpkg-i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.debsudo apt-get updatesudo apt-get Install -Y Cuda

To set up the CUDA environment:

At the end of the/etc/profile file, add the CUDA environment variable:

sudo gedit/etc/profile

Path=/usr/local/cuda/bin: $PATH

Export PATH

Once saved, execute the following command to make the environment variable effective immediately

Source/etc/profile

You also need to add the Lib library path: Join the file in/etc/ld.so.conf.d/cuda.conf

sudo gedit/etc/ld.so.conf.d/cuda.conf

The contents are as follows:

/usr/local/cuda/lib64

Once saved, execute the following command to make it effective immediately

sudo ldconfig

CUDNN: Using version 5.0

TAR-ZXVF cudnn-7.5-linux-x64-v5.0-ga.tgz  cd cuda  sudo cp lib/lib*/usr/local/cuda/lib64/   sudo cp include/cudnn.h/usr/local/cuda/include/   /usr/local/cuda/lib64/+r libcudnn.so.5.0.5-sf libcudnn.so.5.0.5 libcudnn.so.5-sf libcudnn.so.5 Libcudnn.sosudo Ldconfig
3 Python Interface compilation

Install git and download Caffe source code:

sudo apt-get install build-essential cmake git pkg-configsudo git clone https://github.com/BVLC/caffe.git

Download Python dependent environment

sudo su sudo apt-get install gfortranpip install--upgrade pipfor req in $ (cat requirements.txt); do pip install $req; done//recommended to use the domestic image installation, you understand, speed fast for  req in $ (cat requirements.txt); Do pip install $req-I http://pypi.douban.com/ Simple Done

Compile: First copy the Makefile.config file, cancel the comment

CP Makefile.config.example Makefile.config

# CuDNN Acceleration Switch (uncomment to build with CuDNN).
USE_CUDNN: = 1

# Uncomment to support layers written in Python (would link against Python libs)
With_python_layer: = 1

Compile the Caffe and Python interfaces using the following command

Make-j
Make PY

4 Calling the Python interface with the Spyder and KDevelop calling C + +

Installation

sudo pip install spydersudo apt-get install KDevelop

ubuntu14.04 Installing the Caffe+python interface

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.