Installing Caffe on Ubuntu 14.04

Installing Caffe on Ubuntu following the available online instruction by the Caffe creators did not work with me. I guess the reason is that the tutorial writers did not use freshly installed Ubuntu to test their instructions which means that some required libraries are already installed , so it is not mentioned in the tutorial. for example the Boost library does not come with a new installation of Ubuntu 14.04 and it is not mentioned in the tutorial.

Here are the steps i followed exactly to get Caffe running.

1- Download and install Ubuntu 14.04 here. the exact ISO file i downloaded is 14.04.4 from this direct link. 14.04 is an LTS (Long Term Support) release which is a better choice than the newer versions.

2- 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 libgflags-dev libgoogle-glog-dev liblmdb-dev

3- CUDA : Caffe original instructions suggests you install CUDA as a next step. for me I skipped this part as I was planning to use CPU only mode. Also, to avoid any troubles with installing CUDA.

4- Install BLAS sudo apt-get install libatlas-base-dev

5- Install GIT sudo apt-get install git

6- get Caffe source : You can put the source anywhere , for me I made sure i am at the home directory by doing CD ~/ then I start getting the code by git clone https://github.com/BVLC/caffe.git

7- Install Boost : This library is essential for compilation . just type sudo apt-get install libboost-all-dev

8- Pre-compilation : now enter into the caffe folder CD caffe . then we need to adjust the configuration file by first creating a copy of the sample config file cp Makefile.config.example Makefile.config . then you must edit the config file in the text editor by typing gedit Makefile.config then uncomment CPU_ONLY := 1 and save.

9- Compiling : start compiling by typing make all hopefully things will run smoothly. then you should test that everything is ok by typing make test and also make runtest

Good Luck.

2 Replies to “Installing Caffe on Ubuntu 14.04”

Leave a Reply

Your email address will not be published. Required fields are marked *