Installing Caffe on Ubuntu 16.04

in #caffe7 years ago

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

And finally after runtest you’ll see this

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:

Thank you, Hope this helped you ...

Sort:  

Congratulations @aquib! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!