Tested on:Kubuntu Linux 14.04
Prerequisites:Computer with Ubuntu 14.04 installed

Installing the Google Deepdream software

In the GoogleResearch blog post Interceptionism: Going deeper into Neural Networks, the software engineers Alexander Mordvintsev, Christopher Olah, and Mike Tyka present the usage of Neural Networks for generating astounding psychedelic images.
Amazingly, they shared the method as an Ipython Notebook on GitHub– thanks to the developers!

DeepDream has a lot of requirements and the installation is lenghty and difficult. Thanks to user Nasenspray on Reddit who posted some good hints for installing DeepDream. The Caffe installation mostly follows the tutorial for installation and compilation on berkelyvision.com. After setting up Ubuntu Linux, DeepDream can even be installed on a Raspberry Pi 2, e.g. for building a psychedelic surveilance camera.

Install Anaconda
Anaconda is a bundle of scientific computing software for Python. Anaconda contains many packages required for DeepDream. Go to Continuum.io and download Anaconda for Python 2.7. Install Anaconda with

Install basic dependencies
These are the basic dependencies to install:

Install caffe
Caffe is a deep learning framework from Berkleyvision and necessary for running a DeepDream. Install and compile Caffe with

Replace the line


Save the file and type in the terminal

Then, open the .bashrc with sudo nano ~/.bashrc and add at the end of the file

with USERNAME being the linux user name.
Safe and reload .bashrc with

Install Protobuf
Protobuf is Googles take on serializing structured data and a requirement of DeepDream. Install it with

Open .bashrc with sudo nano ~/.bashrc and append this path at the end of the file:

Safe and reload .bashrc again with

Now, install Protobuf with

Install DeepDream
Finally, everything is in place. Clone and install the DeepDream notebook with

Start DeepDream
Run the IPython Notebook with

If the Notebook does not open in the browser directly, open a browser window and visit

Now, all needed for creating the amazing DeepDream images is in place. Play with the notebook by changing parameters and using different images. Alternatively, play with the script deepdreaming.py which comes with the git repository:

DeepDream of a Lake

DeepDream of a Lake

Interceptionism: Going deeper into Neural Networks: http://googleresearch.blogspot.ch/2015/06/inceptionism-going-deeper-into-neural.html
NasenSpray comment: https://www.reddit.com/r/deepdream/comments/3bvxgl/deepdream_for_nonprogrammers/
Berkleyvision Caffe installation: http://caffe.berkeleyvision.org/install_apt.html
Berkleyvision Caffe compilation: http://caffe.berkeleyvision.org/installation.html#compilation
Continuum.io Anaconda download: http://continuum.io/downloads
Berkleyvision Caffe: http://caffe.berkeleyvision.org
Google Protobuf: https://developers.google.com/protocol-buffers/
DeepDream GitHub: https://github.com/google/deepdream
IPython Notebook Info: http://ipython.org/notebook.html
DeepDream Image Gallery: http://s478.photobucket.com/user/wirsing/library/DeepDream
DeepDream on a Raspberry Pi Tutorial: http://www.knight-of-pi.org/deepdreaming-on-a-raspberry-pi-2/
psychedelic surveilance camera: http://www.knight-of-pi.org/psycam-a-raspberry-pi-deepdream-surveilance-camera/
DeepDream GitHub: https://github.com/google/deepdream

Knight of Pi

Johannes Bergs aka Knight of Pi. Diploma in Bioinformatics, some Webdesign and Python coding then. Living in the beautiful city of Vienna.


  1. Thanks a lot ..seen tranverse .. but installs semme easier as well described ! TY
    then deepdream is to be trained ..
    1 – with some other images than the little dogs .. HOW ?
    2 – which file is used ?
    3 – or how to parameter a repository to make deepD “learn” those images recognition or even the style to put on our pict ?

    Thanks a lot for the methodic step by step (not till used) but to have also the containers used to make transformations, explicitly with other things than dogs
    in a way there are 2 methods: 1 is to make a “styled as” picture and 2 is to make deepD try to recognise something and also replace that in its learning by the artefact-iconized object (eg dogs)

    • Hmmm not sure i got you, but: building training data sets (other than little dogs) is difficult. I tried other trained nets, but failed to give good network structures. If you make progress here, i’d love to hear about it!
      In fact, all the different styles you’re seeing are just different layers of the same network. Deep layers -> dogs and eyes, top layers -> abstract structures.

  2. Hello, im having a problem, when i run the ipython notebook i get this error:

    ImportError: No module named _caffe

    and i did this
    make pycaffe

    • Hi Daniel,

      that could be because libraries with different Python versions were linked.

      Please try the updated installation procedure i made for the MagPi. It’s here
      on page 58. The installation should work for Raspberry Pis and normal computers with a recent Ubuntu. Debian might work out of the box as well.

  3. Hi,

    I have made it through most of the installation steps and now am at the point where I can run deepdreaming.py –help with no errors. However, I am unable to download bvlc_googlenet.caffemodel. The link http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel does not respond. I don’t know if this is a temporary outage or not. Do you know if there is an alternative place to get this from?


  4. I seem to not know how to get ipython running properly. It’s been replaced by something called jupyter. I run it and are able to connect to the web port it is listening on but I receive the message “Kernel not found: None” I can see the notebook but cannot execute any commands.
    I cannot work out how to install a kernel.

  5. i got this error:
    paul@Paul-PC ~/deepdream/caffe $ make all
    CXX src/caffe/solver.cpp
    In file included from src/caffe/solver.cpp:8:0:
    ./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory
    compilation terminated.
    Makefile:572: recipe for target ‘.build_release/src/caffe/solver.o’ failed
    make: *** [.build_release/src/caffe/solver.o] Error 1

  6. Hi,

    Thanks a lot. I don’t have a fresh install either, but it miss at least the package python-virtualenv to have easy_install in Protobuf and you need sudo for python setup.py install .

    Otherwise, if an error appears when opening the notebook, it can be because the version of ipython is too old (it’s the case in Ubuntu 14.04 Trusty).
    so, just do
    sudo apt-get remove ipython python-tornado
    sudo apt-get autoremove
    pip install ipython
    pip install jupyter
    pip install tornado
    That’s should do the job.


    • Cool, thanks for the update!
      Additionally, i managed to install DeepDream on Ubuntu 15.1; it’s mostly the same installation routine as described in this tutorial.

Leave a Reply to Knight of Pi Cancel reply

Time limit is exhausted. Please reload CAPTCHA.