Installing Caffe on Linux

First download caffe from github:

$> git clone https://github.com/BVLC/caffe.git
$> cd caffe
$> cp Makefile.config.example Makefile.config

Edit Makefile.config
Make a copy of Makefile.config
Make the following changes to Makefile.config:
Uncomment: CPU_ONLY := 1
Uncomment the right PYTHON_INCLUDE path. If you have anaconda installed, uncomment the anaconda path for PYTHON_INCLUDE and PYTHON_LIB

Compile:
make clean
make all
make test
make runtest

You might encounter the following error during make runtest:
Error loading shared library libhdf5_hl.so.xx
In such a case, look for libhdf5_hl.so.xx in /usr/lib/x86_64-linux-gnu. If you do not find the correct version .xx and instead .yy, just copy .yy to .xx in the same folder. And it should run. For example, you might have the .7 version but your current caffe installation is looking for .8 version such as the listing shown below:
This is what exists:
/usr/lib/x86_64-linux-gnu/libhdf5_hl.so.7
/usr/lib/x86_64-linux-gnu/libhdf5.so.7

Copy above files to the following:
/usr/lib/x86_64-linux-gnu/libhdf5_hl.so.8
/usr/lib/x86_64-linux-gnu/libhdf5.so.8

And you are good to go :)

Leave a Reply

Your email address will not be published.

ALL COMMENTS ARE MODERATED. PLEASE LEAVE YOUR COMMENT AND THE ADMINISTRATOR WILL REVIEW IT BEFORE POSTING. THANK YOU. You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>