4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Installing Caffe on Ubuntu 16.04

Hi everyone,

In this post, I would like to show how to build Caffe a deep learning framework, developed by Berkeley AI Research.

System configuration: Ubuntu 16.04, CPU AMD A4 processor.
Why I am writing this post is, when I tried to build Caffe I found few issues. So, I tried many things and finally end up with the following steps which helps in building Caffe on my system.

Let's begin, we will first create folder named 'deep-learning'

$ cd
$ mkdir deep-learning
$ cd deep-learning

Installing the 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
$ sudo apt-get install the python-dev
$ sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

Compile and Install Caffe
The Caffe repository is hosted on GitHub. To clone the repository enter the below command in the terminal.

cd ~/deep-learning
git clone http://github.com/BVLC/caffe.git
cd caffe

The Makefile.config.example contains the template for the configuration file. We’ll use it to write the Makefile.config configuration file.

cp Makefile.config.example Makefile.config
In the Makefile.config the file we need to set options if we want to use a CPU or a GPU. Open your editor and uncomment the line CPU_ONLY := 1 (probably, online number 8) as shown below.
Change #CPU_ONLY := 1 to CPU_ONLY := 1

cd /path/to/caffe/folder
mkdir build
cd build
cmake ..
make all
make install
make runtest

**After the build command you’ll see something like this
https://aquibjk.files.wordpress.com/2016/10/after-build-files.png?w=646

And finally after runtest you’ll see this
https://aquibjk.files.wordpress.com/2016/10/runtest.png?w=646

Wrapping Python
To add PYTHON support, run the below commands in the terminal.

cd ~/deep-learning/caffe
make pycaffe
echo export PYTHONPATH=~/deep-learning/caffe/python:$PYTHONPATH >> ~/.bashrc

Now it’s time for the test:
https://aquibjk.files.wordpress.com/2016/10/final.png?w=646

Thank you, Hope this helped you ...

5 upvotes $0.01

Replies (1)

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: