Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Caffe Installation on Ubuntu

Overview

Caffe is a deep learning framework made with expression, speed, and modularity in mind. It is developed by the Berkeley Vision and Learning Center (BVLC) and by community contributors.


Installation:

First, you need to install the general dependencies using the following command:

$ sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler

After installing these, you need to install three more dependencies:

  • CUDA is required for GPU mode. Installing CUDA is optional but it is recommended for better performance. To install CUDA, you can visit the link https://developer.nvidia.com/cuda-downloads and then you can download CUDA for Ubuntu 14.04. Start the download and go get some coffee since it is quite large and will take time to download. After successful download, install it.
  • BLAS : Install ATLAS by sh sudo apt-get install libatlas-base-dev or install OpenBLAS or MKL for better CPU performance.
  • BOOST : BOOST C++ library can be downloaded and installed through Sourceforge.
  • OpenCV 2.4 or above: For installing OpenCV, follow this link.
  • Python: If you use the default python, then you will need to sudo apt-get install python-dev package.

Compilation:

Now you need to edit the config file (Makefile.config). Create the config file by copying the contents of Makefile.config.example file to Makefile.config using the following command: sh cp Makefile.config.example Makefile.config

After this, you need to change the configurations in Makefile.config file. Change the config according to the following conditions:

  • For cuDNN acceleration, you should uncomment the USE_CUDNN := 1 switch in Makefile.config.
  • For CPU-only Caffe, uncomment CPU_ONLY := 1 in Makefile.config.

The complete configuration of my Makefile can also be found on the current repo.

After making successful changes in the configuration file, you need to run the following commands:

make all
make test
make runtest

(Before running next two compilation commands, you need to make sure that you have set PYTHON and MATLAB path in Makefile.config) To compile the PYTHON wrappers, you need to run the command,

make pycaffe

To compile the MATLAB wrappers, you need to run the command ,

make metacaffe

Finally, if you have reached here, then you have installed Caffe on your System successfully.

License

MIT