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

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.

Disclaimer
Installing DeepDream in a virtual environment didn’t work, so i had to perform a system-wide installation. Since setting up a new system for testing the tutorial is very time consuming, this tutorial just wraps up the installation as i remember it. The installation of some packages may be missing and some commands may be run with or without sudo permission.

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

with

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

Links
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/Caffe
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.

9 Comments

  1. 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?

    Thanks

  2. 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.

  3. 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

  4. 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.

    Cheers.

    • 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.

Comment

Time limit is exhausted. Please reload CAPTCHA.