In this tutorial, I will detail the steps for installing Caffe on a non-GPU(CPU) machine with Ubuntu 14.04 OS. Once we are done with the installation, we’ll also test the GOOGLE INCEPTIONISM (deepdream) code which uses Caffe. This is a follow up post to my last post – Generating images with Google’s “INCEPTIONISM” – deepdream where I had shared some awesome images generated using deepdream code. So, let’s get our hands dirty straight away .

Firstly, let’s make a directory named deep-learning in the \$HOME folder where we will download all the packages.

## 1. Installing the dependencies

To successfully compile Caffe we need to install a few packages first. Execute the below command in the terminal. (These commands will require root access)

NOTE -> Since we will not be using GPUs, we do not require CUDA installation.

## 2. Compile and Install Caffe

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

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

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

After setting the configuration, the next step is to make Caffe or brew Caffe .

### NOTE

If you get an OpenCV undefined reference error in make all as shown below follow the instructions below else move to the section 3.

(Check this issue) for more details. In order to fix the errror, append opencv_imgcodecs on line 176(most probably) as shown below.

Now clear of the contents of build. This is important else the error will persist.

Now rerun the previous commands.

To add PYTHON support, run the below commands in the terminal. We need Python support to run the deepdream code.

## 4. Running the INCEPTIONISM code

To run the INCEPTIONISM code follow the below instructions.

### 4.3. Run the IPython Notebook

Now the IPython notebook dashboard will open up in your default browser as shown below.

In the list of files, click on dream.ipynb and you will get an output as shown in the figure below.

So, this is it ! Use this IPython Notebook to play with the deepdream code to generate some awesome images. I hope you liked the post and THANK YOU for reading.