Running Google’s Deep Dream on Windows (with or without CUDA) – The Easy Way

I recently made a post detailing how to get Google's Deep Dream up and running on Windows by compiling Caffe and completing a few other steps, but I believe I've simplified the process quite a bit and will share my results with you.

Prerequisites

64-bit Windows

You must have a 64-bit version of Windows installed. Pretty much any edition (7, 8, 8.1, 10) as long as you've got the 64-bit version.

Anaconda Python

https://store.continuum.io/cshop/anaconda/

This is essentially the only program we will need. Be sure to install the 64-bit version of Python 2.7.

Anaconda_download

Install to the default location (C:\Anaconda), or remember where you install to for later use.

Anaconda_install

Choose to add Anaconda to the PATH variable and register as the system's Python 2.7

Anaconda_path

That's pretty much it for required programs, unless you're going to use CUDA.

Choose Your System Configuration

You'll need to figure out if you have a CUDA enabled graphics card, and what level of Compute Capability it supports.

No CUDA Enabled Graphics Card

You'll need the CPU_ONLY version of Caffe. Get it here:
https://mega.co.nz/#!GVpW0LZJ!Orwv9g_oYvTRvvq2Lzb-jDszvrqh334wCepQqMx8QPo

and extract the file to the directory where you installed Anaconda, for instance (C:\Anaconda)

Make sure to get the 3rd party addons in the section below.

CUDA Enabled Graphics Card

UPDATE: This section now reflects using CUDA v7.5 instead of v7.0. The download link for my files built with v7.0 will still be here, find them at the end of this section.

First you'll need CUDA v7.5. Get it here:
https://developer.nvidia.com/cuda-downloads

When installing, be sure to choose "Custom (Advanced)" to choose whether or not to install a graphics driver. If you're using an Nvidia card in Windows, you likely already have a more recent driver installed than what is packaged with CUDA.

CUDAInstaller_Custom

The only thing you need to select when installing is the Toolkit.

UPDATE: You will most likely need to reboot your system for CUDA to be found by Anaconda and Caffe. If you're having problems with a "DLL load failed" error, reboot your system and try again. Thanks to Lonnie Waugh for figuring this one out!

UPDATE: There were previously 2 versions posted, one with access to cuDNN and one without. cuDNN seems to actually slow down Deep Dream processing, so I'm only posting the version without cuDNN now.

Get the regular CUDA v7.5 enabled version of Caffe here:
https://mega.nz/#!aURgBaoA!rg77CExAjyLFUdsIJHdauBXjJHAx_CT5I9LcRYP4V2M

and extract the file to the directory where you installed Anaconda, for instance (C:\Anaconda)

Note: if you are running CUDA v7.0, you will need this file package:
https://mega.co.nz/#!GZ4GWApJ!XSutQ3D-zHkGxFi2FlDpqjuB73VghGtHdjdjAPxPH8A

 

Required 3rd Party Addons

These are required no matter which system configuration you chose. Everything you need is in this zip:
https://mega.co.nz/#!OEJCDbKA!7ni3fPeQJFBouwe9izrLW4MNQHYSEUpG1ZL7vXBCPXs

Extract to your Anaconda directory, for instance (C:\Anaconda)

This includes all the files you'll need for Deep Dream as well.

Running Deep Dream

We're ready to start dreaming! Go to Start -> All Programs -> Anaconda (64-bit) -> Anaconda Command Prompt to bring up a command prompt for Anaconda.

Type ipython notebook dream.ipynb and you should see a browser window open with the IPython Deep Dream notebook.

Click on the first In[ ] cell, and press the little "Play" button near the top of the window. Once In[*] changes to In[1], that cell has completed execution. Click on the next In[ ] cell and press "Play", continuing on through the rest of the In[ ] cells.

The notebook has comments and information written as you go through it, if you want to figure out what is going on at each step.

Hope this helps everyone get this up and running easily!

Happy Dreaming!

Brian T.

78 thoughts on “Running Google’s Deep Dream on Windows (with or without CUDA) – The Easy Way

  1. Using with cuda but without cudnn I get this on the second code block
    IOError Traceback (most recent call last)
    in ()
    6 # Note that you can also manually add “force_backward: true” line to “deploy.prototxt”.
    7 model = caffe.io.caffe_pb2.NetParameter()
    —-> 8 text_format.Merge(open(net_fn).read(), model)
    9 model.force_backward = True
    10 open(‘tmp.prototxt’, ‘w’).write(str(model))

    IOError: [Errno 2] No such file or directory: ‘./caffe/models/bvlc_googlenet/deploy.prototxt’

  2. Well the no cuda version works like a champ so thanks for that! The cuda without cudnn still blows up for me at the first stage where it begins to alter the original image.

    1. Hmm, what size image are you working with?

      What error do you get when python crashes? Is there anything in the command prompt window?

      1. The error in the command window:
        I0719 20:35:37.559237 6904 net.cpp:235] This network produces output prob
        I0719 20:35:37.559237 6904 net.cpp:482] Collecting Learning Rate and Weight Dec
        ay.
        I0719 20:35:37.559237 6904 net.cpp:247] Network initialization done.
        I0719 20:35:37.559237 6904 net.cpp:248] Memory required for data: 545512320
        E0719 20:35:37.691243 6904 upgrade_proto.cpp:618] Attempting to upgrade input f
        ile specified using deprecated V1LayerParameter: ./caffe/models/bvlc_googlenet/b
        vlc_googlenet.caffemodel
        I0719 20:35:37.740247 6904 upgrade_proto.cpp:626] Successfully upgraded file sp
        ecified using deprecated V1LayerParameter
        F0719 20:36:47.596012 6904 syncedmem.cpp:51] Check failed: error == cudaSuccess
        (2 vs. 0) out of memory
        *** Check failure stack trace: ***
        [I 20:36:55.417 NotebookApp] Saving file at /dream.ipynb
        [W 20:36:55.427 NotebookApp] Saving untrusted notebook dream.ipynb

        I had chosen a smaller image on purpose for this test so it actually blew through (as compared to CPU only speed) 19 iterations before it failed. I setup task manager so I could watch it and my system RAM only went up slightly. It was just over 4 GB and I have 12 in the machine so it has to be the vid card RAM that is running out. This is an older card so it only has 1GB.

        I can’t find a setting in the NVidia control panel to allow the card to use system RAM.

        1. Hey Matt. [And thank you Brian!]

          I seem to be getting the same error as you and read that I had to adjust the batch_size to a lower amount; however I was only able to find this in a few files, like train_val.prototxt and it didn’t resolve my issue.

          Were you able to fix this issue?

          Thanks in advance.

  3. Cool, thank you, the cpu version works but the no cudnn version throws an error on the first section saying it can’t import caffe (my gfx card is cc 2.1):

    ImportError Traceback (most recent call last)
    in ()
    7 from google.protobuf import text_format
    8
    —-> 9 import caffe
    10
    11 caffe.set_device(0)

      1. Yep, I have CUDA installed. The Anaconda prompt window doesn’t have any errors and I have included the full notebook error below. Don’t lose any sleep over it (I’m sure you won’t anyway), the CPU version works fine, I just thought you might want to know that the non-CUDNN version doesn’t seem to. Many thanks Brian :-)

        —————————————————————————
        ImportError Traceback (most recent call last)
        in ()
        7 from google.protobuf import text_format
        8
        —-> 9 import caffe
        10
        11 caffe.set_device(0)

        C:\Anaconda\lib\site-packages\caffe\__init__.py in ()
        —-> 1 from .pycaffe import Net, SGDSolver
        2 from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver
        3 from .proto.caffe_pb2 import TRAIN, TEST
        4 from .classifier import Classifier
        5 from .detector import Detector

        C:\Anaconda\lib\site-packages\caffe\pycaffe.py in ()
        11 import numpy as np
        12
        —> 13 from ._caffe import Net, SGDSolver
        14 import caffe.io
        15

        ImportError: DLL load failed: The specified module could not be found.

  4. Hi Brian,

    I tried this procedure as well (seemed much simpler than compiling caffe) but I get the same error:

    ImportError Traceback (most recent call last)
    in ()
    7 from google.protobuf import text_format
    8
    —-> 9 import caffe
    10
    11 caffe.set_device(0)

    C:\Anaconda\lib\site-packages\caffe\__init__.py in ()
    —-> 1 from .pycaffe import Net, SGDSolver
    2 from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver
    3 from .proto.caffe_pb2 import TRAIN, TEST
    4 from .classifier import Classifier
    5 from .detector import Detector

    C:\Anaconda\lib\site-packages\caffe\pycaffe.py in ()
    11 import numpy as np
    12
    —> 13 from ._caffe import Net, SGDSolver
    14 import caffe.io
    15

    ImportError: DLL load failed: The specified module could not be found.

    Can’t see how to fix the problem?

    1. Any idea how to fix this? I followed the tutorial step by step, tried to delete content from all the previous installation and reinstall again, still the same problem!

      1. It seems like it can’t find some .dll file that was probably included in the 3rd party files, but python doesn’t really give much information as to WHICH .dll might not be able to be loaded.

        Are you sure you extracted the files into the Anaconda directory? The .dll files from the 3rd party zip need to be in a directory in your PATH environment variable, and the easiest way to do this is to put them in the Anaconda directory (C:\Anaconda or similar), because when you run the Anaconda Command Prompt, it will automatically add that directory to the PATH variable.

  5. I keep getting this message at block 6:
    “C:\Anaconda\lib\site-packages\scipy\ndimage\interpolation.py:549: UserWarning: From scipy 0.13.0, the output shape of zoom() is calculated with round() instead of int() – for these inputs the size of the returned array has changed.
    “the returned array has changed.”, UserWarning)”

    I’ve tried smaller images and nothing seems to be working. I’m running the no CUDA version, 8Gb RAM. Everything up until that point seems to be working just fine.

  6. Does anyone have any experience implementing the places205CNN caffe model? I downloaded it, put it in the model directory and implemented it in the “Loading DNN model” cell of the workbook. I copied the deploy.prototext from the googlenet directory as the layer definitions looked very different. Running the deepdream cell seems to work but nothing really interesting is coming out.

    Should I be using their supplied deploy file and if so, what should be my end layer? If not that, what else needs to change to make places205CNN work it magic?

    I’ll accept that I’ve done something stupid but I’ve only spent 24 hrs on this and haven’t used python before.

    Thanks,
    Martin.

    1. I guess I’ll answer my own question.

      From what I have seen, GoogLeNet is the only model that can be easily be used to produce these images. You can replace the standard blvc_googlenet one with the MIT places one provided that you use a GoogLeNet copy of it.

      To use it do the following:

      Down load Places205-GoogLeNet.tar (bottom link) at http://places.csail.mit.edu/downloadCNN.html

      Unpack it into its own directory in C:\Anaconda\caffe\models . The name I used was googlenet_places205

      In the “Loading DNN model” section of your workbook, change the top three lines to:

      model_path = ‘./caffe/models/googlenet_places205/’
      net_fn = model_path + ‘deploy_places205.protxt’
      param_fn = model_path + ‘googlelet_places205_train_iter_2400000.caffemodel’

      (Note it is named .protxt rather than .prototxt )

      Run the workbook from there and you have the building rather than dogs.

      Martin

  7. Hey Brian, glad you simplified this great tut. So I have a GTX 970 which should be able to do CuDNN. Should I just copy that CuDNN enabled ver of Caffe over my old caffe installation?

  8. Hi. This guide is great, thank you very much! There is one question – is it possible to work with images in any folder? for example with a folder C: \Users\name\Pictures

  9. Hey, I’m running the cpu version and I’m also getting the error:

    ImportError Traceback (most recent call last)
    in ()
    7 from google.protobuf import text_format
    8
    —-> 9 import caffe
    10
    11 caffe.set_device(0)

    C:\Anaconda\lib\site-packages\caffe\__init__.py in ()
    —-> 1 from .pycaffe import Net, SGDSolver
    2 from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver
    3 from .proto.caffe_pb2 import TRAIN, TEST
    4 from .classifier import Classifier
    5 from .detector import Detector

    C:\Anaconda\lib\site-packages\caffe\pycaffe.py in ()
    11 import numpy as np
    12
    —> 13 from ._caffe import Net, SGDSolver
    14 import caffe.io
    15

    ImportError: DLL load failed: The specified module could not be found.

    Please tell me how to fix this!

    1. Hmm, most likely you need to get the 3rdparty.zip file and extract it to C:\Anaconda (or wherever you installed Anaconda). Make sure you use the Anaconda Command Prompt from the start menu to ensure Anaconda has the proper PATH variable set.

    2. I fixed this by simply rebooting after installing cuda .. then I reinstalled all of the files from the zips to reset the notebook .. after that I was good to go

  10. Hello, sorry if this question sounds really newbie, I’m a beginner and just learning about deep dreaming.

    I’ve installed everything you mentioned in this article and I think all dependencies are met. After I execute dream.ipynb in the console, it fires up browser with a python notebook interface. But, at this stage, I didn’t get the first `In[ ]` cell. I need to add it manually to make it appear. After it appears, I clicked the play button and it does nothing.

    Can you kindly guide me on this and how should it suppose be done?

    Thanks,
    Aiman

    1. That’s strange, you just get a blank notebook? Did you get the .zip file that has a “dream.ipynb” file in it?

  11. First, a thank you to Brian and the rest. I got this up and running in CUDA (not cuDNN as my GTX640 with 1024 MB dedicated VRAM has CC 2.1)

    With very small images Dreamify.py does run successfully and much quicker than in CPU mode but with larger images it quickly runs out of GPU dedicated memory and throws a stack trace error. However, Process Explorer shows some 3GB of shared GPU memory which the GPU doesn’t use.

    Question: Is there any way to force usage of shared GPU memory when needed?

    1. Not really. In order to do calculations on the GPU, the data must be loaded into the GPU memory, rather than just in main memory. There are ways to get it to swap out data when the GPU memory is full, but it vastly slows down the computation. The longest part of the CUDA execution is copying memory to and from the GPU, usually.

  12. Getting this error at block 6. No CudA running, 8 gigs of RAM. Any idea what’s going on?

    —————————————————————————
    KeyError Traceback (most recent call last)
    in ()
    —-> 1 _=deepdream(net, img)

    in deepdream(net, base_img, iter_n, octave_n, octave_scale, end, clip, **step_params)
    18 src.data[0] = octave_base+detail
    19 for i in xrange(iter_n):
    —> 20 make_step(net, end=end, clip=clip, **step_params)
    21
    22 # visualization

    in make_step(net, step_size, end, jitter, clip, objective)
    7
    8 src = net.blobs[‘data’] # input image is stored in Net’s ‘data’ blob
    —-> 9 dst = net.blobs[end]
    10
    11 ox, oy = np.random.randint(-jitter, jitter+1, 2)

    KeyError: ‘inception_4c/output’

    1. It looks like it hasn’t set up all the variables correctly, or you’re using a model that doesn’t have “inception_4c/output” as one of its keys. Did you step through each In[ ] block in order?

      1. I did run through the script numerically. but I thought I’d just be able to substitute MIT’s places model (providing I had all the files in the correct location.) Should I assume that’s not the case? I’m trying to crash-course in Python but a lot of it’s still way over my head…

        1. Yeah, each model might have different layers. One of the In[ ] blocks should have net.blobs.keys() in it, if you run that block, it should return all of the available layers for that model. I haven’t actually done this yet, but I think that should work.

  13. I have tried all versions this is the error I keep getting.

    ImportError Traceback (most recent call last)
    in ()
    5 import PIL.Image
    6 from IPython.display import clear_output, Image, display
    —-> 7 from google.protobuf import text_format
    8
    9 import caffe

    ImportError: No module named google.protobuf

  14. i have no idea how to import my own image or find where the cloud one went? i click on each [] and pressed play. After this nothing happened i don’t think?

    1. Check anaconda’s folder and then \frames. This is the folder where the frames are.

      For you pic, just make a backup of the original one and replace with your own. The same for the guide, observing the issue with size.

      1. I can’t seem to get a new image to deepdream with. I tried putting the image in the frames folder but that didn’t work. Please help.

  15. Really enjoying this a lot… It looks like 1024×768 is sort of the max resolution of the image before it errors out. Any advice on processing larger images?

  16. The most common case would be that you already have a container running, and you’re trying to run another one. Two containers cannot run at the same time, on the same port.

  17. Like so many above.. I followed the directions to a tee and I get the Import caffe error ..

    1. Yes my card is 3.0 or higher
    2. Yes I installed Cuda
    3. Yes I installed the third party zip and verified it was in the Anaconda folder
    4. Yes I installed the cudnn zip
    5. Yes I also tried the cuda_nocudnn.zip
    6. Yes I’m running with the Anaconda console
    7. Yes I even verified that Anaconda is in the path variable

    The error, which is the same as several above..

    ImportError Traceback (most recent call last)
    in ()
    7 from google.protobuf import text_format
    8
    —-> 9 import caffe
    10
    11 caffe.set_device(0)

    c:\Anaconda\lib\site-packages\caffe\__init__.py in ()
    —-> 1 from .pycaffe import Net, SGDSolver
    2 from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver
    3 from .proto.caffe_pb2 import TRAIN, TEST
    4 from .classifier import Classifier
    5 from .detector import Detector

    c:\Anaconda\lib\site-packages\caffe\pycaffe.py in ()
    11 import numpy as np
    12
    —> 13 from ._caffe import Net, SGDSolver
    14 import caffe.io
    15

    ImportError: DLL load failed: The specified module could not be found.

  18. Solved my own issue…. how?

    A simple reboot …. Cuda doesn’t prompt you to reboot when you install it so I assumed the install was fine… I then realized after messing with it for over an hour that a reboot may be needed.. I would highly recommend adding a reboot step after installing Cuda =)

    Extremely fast renders.. I love it

    1. Awesome, thanks! I was really wondering what was happening for people with this problem.

      Most likely CUDA adds itself to the PATH environment variable when its installed, but might need a reboot for the system to recognize the changed PATH variable. I’ll add it to the guide. Thanks again!

  19. I’m having some trouble here. I downloaded everything listed, but when I type the ipython notebook dream.ipynb into cmd, it says “no file or directory”. My system specs are as follows:

    OS: Windows 7 premium 64 bit
    GPU: Intel(R) HD Graphics 1760 mb
    (does not support CUDA)

    Any help would be extremely appreciated (:

  20. This tutorial like all the others on the internet does not deliver the result quite…

    The cpu version on top of Anaconda 2 installation gave the proof of concept, but the DLLs could not be loaded in any way.

    I installed the separate copy of CUDA 7 toolkit that is evoked by:
    conda install cudatoolkit
    in Anaconda 2 command prompt.

    This gave me the files from the DLLs folder in Anaconda folder, which I then copied to the folder where the dream notebook is. It is not obvious which DLLs are required, but this seems to work.

    There is no need to litter the Anaconda root folder or keep the notebook there since it does not work with DLLs anyway.

  21. ipython.exe 2284 ntdll.dll, KERNEL32.DLL, KERNELBASE.dll

    python.exe 2964 ntdll.dll, KERNEL32.DLL, KERNELBASE.dll,
    python27.dll, MSVCR90.dll, USER32.dll,
    ADVAPI32.dll, SHELL32.dll, GDI32.dll,
    msvcrt.dll, sechost.dll, RPCRT4.dll,
    combase.dll, SHLWAPI.dll, IMM32.DLL,
    MSCTF.dll, _hashlib.pyd, CRYPTSP.dll,
    rsaenh.dll, bcrypt.dll, CRYPTBASE.dll,
    bcryptPrimitives.dll, _ctypes.pyd,
    ole32.dll, OLEAUT32.dll, win32security.pyd,
    NETAPI32.dll, pywintypes27.dll,
    netutils.dll, srvcli.dll, wkscli.dll,
    Secur32.dll, security.dll, ntdsapi.dll,
    WS2_32.dll, NSI.dll, SSPICLI.DLL,
    LOGONCLI.DLL, _socket.pyd, _ssl.pyd,
    CRYPT32.dll, MSASN1.dll, _sqlite3.pyd,
    sqlite3.dll, napinsp.dll, pnrpnsp.dll,
    NLAapi.dll, mswsock.dll, DNSAPI.dll,
    winrnr.dll, select.pyd, libsodium.pyd,
    libzmq.pyd, MSVCP90.dll, constants.pyd,
    error.pyd, message.pyd, context.pyd,
    socket.pyd, utils.pyd, _poll.pyd,
    _version.pyd, _device.pyd,
    _multiprocessing.pyd, monitoredqueue.pyd,
    _speedups.pyd, speedups.pyd,
    unicodedata.pyd, win32api.pyd, VERSION.dll,
    fwpuclnt.dll, rasadhlp.dll, SHCORE.dll,
    uxtheme.dll, kernel.appcore.dll,
    tiptsf.dll, PROPSYS.dll, apphelp.dll,
    clbcatq.dll, iertutil.dll, comctl32.dll,
    urlmon.dll, WININET.dll, USERENV.dll,
    profapi.dll, MLANG.dll

    ipython.exe 8636 ntdll.dll, KERNEL32.DLL, KERNELBASE.dll

    python.exe 204 ntdll.dll, KERNEL32.DLL, KERNELBASE.dll,
    python27.dll, MSVCR90.dll, USER32.dll,
    ADVAPI32.dll, SHELL32.dll, GDI32.dll,
    msvcrt.dll, sechost.dll, RPCRT4.dll,
    combase.dll, SHLWAPI.dll, IMM32.DLL,
    MSCTF.dll, _hashlib.pyd, CRYPTSP.dll,
    rsaenh.dll, bcrypt.dll, CRYPTBASE.dll,
    bcryptPrimitives.dll, _ctypes.pyd,
    ole32.dll, OLEAUT32.dll, win32security.pyd,
    NETAPI32.dll, pywintypes27.dll,
    netutils.dll, srvcli.dll, wkscli.dll,
    Secur32.dll, security.dll, ntdsapi.dll,
    WS2_32.dll, NSI.dll, SSPICLI.DLL,
    LOGONCLI.DLL, _socket.pyd, _ssl.pyd,
    CRYPT32.dll, MSASN1.dll, _sqlite3.pyd,
    sqlite3.dll, napinsp.dll, pnrpnsp.dll,
    NLAapi.dll, mswsock.dll, DNSAPI.dll,
    winrnr.dll, select.pyd, libsodium.pyd,
    libzmq.pyd, MSVCP90.dll, constants.pyd,
    error.pyd, message.pyd, context.pyd,
    socket.pyd, utils.pyd, _poll.pyd,
    _version.pyd, _device.pyd,
    _multiprocessing.pyd, monitoredqueue.pyd,
    _speedups.pyd, speedups.pyd,
    unicodedata.pyd, win32api.pyd, VERSION.dll,
    fwpuclnt.dll, rasadhlp.dll, SHCORE.dll,
    uxtheme.dll, kernel.appcore.dll,
    tiptsf.dll, PROPSYS.dll, apphelp.dll,
    clbcatq.dll, iertutil.dll, comctl32.dll,
    urlmon.dll, WININET.dll, USERENV.dll,
    profapi.dll, MLANG.dll

    python.exe 8672 ntdll.dll, KERNEL32.DLL, KERNELBASE.dll,
    python27.dll, MSVCR90.dll, USER32.dll,
    ADVAPI32.dll, SHELL32.dll, GDI32.dll,
    msvcrt.dll, sechost.dll, RPCRT4.dll,
    combase.dll, SHLWAPI.dll, IMM32.DLL,
    MSCTF.dll, _hashlib.pyd, CRYPTSP.dll,
    rsaenh.dll, bcrypt.dll, CRYPTBASE.dll,
    bcryptPrimitives.dll, _ctypes.pyd,
    ole32.dll, OLEAUT32.dll, win32security.pyd,
    NETAPI32.dll, pywintypes27.dll,
    netutils.dll, srvcli.dll, wkscli.dll,
    Secur32.dll, security.dll, ntdsapi.dll,
    WS2_32.dll, NSI.dll, SSPICLI.DLL,
    LOGONCLI.DLL, _socket.pyd, _ssl.pyd,
    CRYPT32.dll, MSASN1.dll, _sqlite3.pyd,
    sqlite3.dll, napinsp.dll, pnrpnsp.dll,
    NLAapi.dll, mswsock.dll, DNSAPI.dll,
    winrnr.dll, libsodium.pyd, libzmq.pyd,
    MSVCP90.dll, constants.pyd, error.pyd,
    message.pyd, context.pyd, socket.pyd,
    utils.pyd, _poll.pyd, _version.pyd,
    _device.pyd, _multiprocessing.pyd,
    monitoredqueue.pyd, select.pyd,
    speedups.pyd, multiarray.pyd, umath.pyd,
    _dotblas.pyd, libiomp5md.dll,
    scalarmath.pyd, _compiled_base.pyd,
    lapack_lite.pyd, _umath_linalg.pyd,
    fftpack_lite.pyd, mtrand.pyd,
    _nd_image.pyd, _ufuncs.pyd,
    libifcoremd.dll, libmmd.dll, imagehlp.dll,
    _ufuncs_cxx.pyd, specfun.pyd, _fblas.pyd,
    _flinalg.pyd, _flapack.pyd,
    _ellip_harm_2.pyd, _odepack.pyd,
    _quadpack.pyd, vode.pyd, _dop.pyd,
    lsoda.pyd, _tkinter.pyd, tcl85.dll,
    tk85.dll, COMDLG32.dll, COMCTL32.dll,
    SHCORE.DLL, _imaging.pyd, _ni_label.pyd,
    _caffe.pyd, cudart64_70.dll,
    cublas64_70.dll, curand64_70.dll,
    hdf5_hl.dll, hdf5.dll, opencv_world300.dll,
    libglog.dll, cudnn64_65.dll,
    libopenblas.dll, MSVCP120.dll,
    MSVCR120.dll,
    boost_python-vc120-mt-1_58.dll,
    dbghelp.dll, zlib.dll, szip.dll,
    MSVFW32.dll, AVIFIL32.dll, AVICAP32.dll,
    libgfortran-3.dll, WINMM.dll, MSACM32.dll,
    VERSION.dll, libquadmath-0.dll,
    libgcc_s_seh-1.dll, WINMMBASE.dll,
    cfgmgr32.dll, DEVOBJ.dll, _elementtree.pyd,
    pyexpat.pyd, _tifffile.pyd, _path.pyd,
    ft2font.pyd, unicodedata.pyd, _png.pyd,
    _cntr.pyd, _image.pyd, _tri.pyd,
    _qhull.pyd, _backend_agg.pyd, sip.pyd,
    QtCore.pyd, QtCore4.dll, QtGui.pyd,
    QtGui4.dll, WINSPOOL.DRV,
    _hough_transform.pyd, _draw.pyd,
    geometry.pyd, _find_contours_cy.pyd,
    _marching_cubes_cy.pyd, _ccomp.pyd,
    _moments_cy.pyd, sigtools.pyd,
    _max_len_seq.pyd, spline.pyd, minpack2.pyd,
    _lbfgsb.pyd, moduleTNC.pyd, _cobyla.pyd,
    _slsqp.pyd, _minpack.pyd, _sparsetools.pyd,
    _csparsetools.pyd, _shortest_path.pyd,
    _tools.pyd, _traversal.pyd,
    _min_spanning_tree.pyd, _reordering.pyd,
    _iterative.pyd, _superlu.pyd, _arpack.pyd,
    _zeros.pyd, _nnls.pyd, _fitpack.pyd,
    dfitpack.pyd, _ppoly.pyd, interpnd.pyd,
    ckdtree.pyd, qhull.pyd, _distance_wrap.pyd,
    _fftpack.pyd, convolve.pyd, _spectral.pyd,
    futil.pyd, vonmises_cython.pyd, _rank.pyd,
    statlib.pyd, mvn.pyd, _pnpoly.pyd,
    generic_cy.pyd, core_cy.pyd,
    percentile_cy.pyd, bilateral_cy.pyd,
    _unwrap_1d.pyd, _unwrap_2d.pyd,
    _unwrap_3d.pyd, _denoise_cy.pyd,
    _nl_means_denoising.pyd, _watershed.pyd,
    _skeletonize_cy.pyd, _convex_hull.pyd,
    _warps_cy.pyd, _radon_transform.pyd,
    nvcuda.dll, SETUPAPI.dll, uxtheme.dll,
    nvapi64.dll, WINTRUST.dll

  22. I am sorry to post so many comments, but another thing to notice:

    The PATH variable in Windows can be formatted like…
    C:\Window\system32; C:\Windows….
    and it works in PowerShell, but not in the ordinary command prompt.

    The problem is in the extra spaces after the semicolon. Delete those and make the perfect path that includes various things such as C:\Anaconda\Scripts…
    C:\Window\system32;C:\Windows

  23. By examining the loaded DLLs, I determined that the complete package should contain 1: gpu cuda + cudnn version
    2: 3rd party libraries package
    3: cudart64_70.dll, cublas64_70.dll, curand64_70.dll available from the DLLs subfolder in Anaconda folder. These files are installed after evoking: conda install cudatoolkit.

    (However, the CUDA Toolkit is installed on my system anyway elsewhere. )

    The package can be unpacked anywhere, given that the dream notebook is edited for path to caffe model file.

    It can be run with: ipython notebook .\dream.ipynb, which requires an automatic upgrade to newer version. (This upgrade fails in PyCharm.)

    Possible failure to load and update the notebook is also noticed in OpenSuSE linux, which requires the forced update of ipython package.

  24. I am trying to install all the stuff (CUDA 6.5 installed because I have a Geforce 9600 GT graphics card). Rebooted multiple times etc. I extracted the zip files to C:\Anaconda

    But.. this is the error

    ImportError Traceback (most recent call last)
    in ()
    7 from google.protobuf import text_format
    8
    —-> 9 import caffe
    10
    11 caffe.set_device(0)

    C:\Anaconda\lib\site-packages\caffe\__init__.py in ()
    —-> 1 from .pycaffe import Net, SGDSolver
    2 from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver
    3 from .proto.caffe_pb2 import TRAIN, TEST
    4 from .classifier import Classifier
    5 from .detector import Detector

    C:\Anaconda\lib\site-packages\caffe\pycaffe.py in ()
    11 import numpy as np
    12
    —> 13 from ._caffe import Net, SGDSolver
    14 import caffe.io
    15

    ImportError: DLL load failed: Kan opgegeven module niet vinden.

    I checked the PYTHONPATH and then this is the result:
    [”, ‘C:\\Anaconda\\python27.zip’, ‘C:\\Anaconda\\DLLs’, ‘C:\\Anaconda\\lib’, ‘C:\\Anaconda\\lib\\plat-win’, ‘C:\\Anaconda\\lib\\lib-tk’, ‘C:\\Anaconda’, ‘c:\\anaconda\\lib\\site-packages\\sphinx-1.3.1-py2.7.egg’, ‘c:\\anaconda\\lib\\site-packages\\setuptools-17.1.1-py2.7.egg’, ‘C:\\Anaconda\\lib\\site-packages’, ‘C:\\Anaconda\\lib\\site-packages\\cryptography-0.9.1-py2.7-win-amd64.egg’, ‘C:\\Anaconda\\lib\\site-packages\\win32’, ‘C:\\Anaconda\\lib\\site-packages\\win32\\lib’, ‘C:\\Anaconda\\lib\\site-packages\\Pythonwin’, ‘C:\\Anaconda\\lib\\site-packages\\IPython\\extensions’]

    Is the path correct? What can I do to solve this?

    1. Have you tried rebooting your system? Sometimes changes to the PATH variable (which CUDA sets automatically) need a restart to take effect. That’s usually what causes the “DLL load failed” error.

      1. When installing the no cuda version of caffe everything works fine. However with the regular CUDA enabled version not. Is it possible that the files do not work with CUDA 6.5?

        1. Ah, yes, oops, I didn’t see that at first. Yes, these are compiled with CUDA 7.0. You’ll need to use my older guide to compile it yourself if you absolutely need to use 6.5.

  25. I have a rig with 3 Radeon R290X cards
    I would be willing to pay someone to get Deep Dream operational on Windows 7

    contact
    deepdreamer4u
    (aT>
    g m a i l (dot)
    com

    1. Woah, nice rig!

      Unfortunately, I haven’t really found a way to utilize AMD cards with CUDA. Someone mentioned Ocelot to me, so I’ve been thinking of trying to compile a version that works with Ocelot…

      But I think that even if someone got Ocelot working in Windows, it’s pretty unlikely to support the benefits of multiple GPUs. Caffe doesn’t really utilize multi GPUs right now, even with direct CUDA support. So I doubt Ocelot would do any better, sadly.

    2. Just follow exactly Brian’s instruction titled “No CUDA Enabled Graphics Card”.
      Works perfectly fine for me on Windows7-64 with one MSI Radeon R290X card only.
      Send *Brian T the check for his fine instructions.
      Good luck.

  26. Should this method also work with CUDA 7.5? That’s the only version I could find… however, I get this error when running the first cell (it already has [1] fwiw):

    —————————————————————————
    ImportError Traceback (most recent call last)
    in ()
    7 from google.protobuf import text_format
    8
    —-> 9 import caffe
    10
    11 caffe.set_device(0)

    C:\Anaconda\lib\site-packages\caffe\__init__.py in ()
    —-> 1 from .pycaffe import Net, SGDSolver
    2 from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver
    3 from .proto.caffe_pb2 import TRAIN, TEST
    4 from .classifier import Classifier
    5 from .detector import Detector

    C:\Anaconda\lib\site-packages\caffe\pycaffe.py in ()
    11 import numpy as np
    12
    —> 13 from ._caffe import Net, SGDSolver
    14 import caffe.io
    15

    ImportError: DLL load failed: The specified module could not be found.

    I’m new to python and have never used notebooks before.

    I have followed the instructions faithfully though. Including several reboots.

    Cheers,
    Paul

    1. No, the version I posted won’t work with CUDA 7.5, since it was built for 7.0, but I will download CUDA 7.5 and make a version for that. I’ll post it here in a little while…

  27. Hmm – something’s not right (first install attempt).

    NameError Traceback (most recent call last)
    in ()
    —-> 1 _=deepdream(net, img)

    NameError: name ‘deepdream’ is not defined

  28. Aww – keep hitting a stumbling block here at step [6]: _=deepdream(net, img)


    I0911 10:34:01.136992 8396 net.cpp:235] This network produces output prob
    I0911 10:34:01.137992 8396 net.cpp:482] Collecting Learning Rate and Weight Decay.
    I0911 10:34:01.137992 8396 net.cpp:247] Network initialization done.
    I0911 10:34:01.137992 8396 net.cpp:248] Memory required for data: 545512320
    E0911 10:34:01.664993 8396 upgrade_proto.cpp:618] Attempting to upgrade input file specified using deprecated V1LayerParameter: ./c
    affe/models/bvlc_googlenet/bvlc_googlenet.caffemodel
    I0911 10:34:01.728992 8396 upgrade_proto.cpp:626] Successfully upgraded file specified using deprecated V1LayerParameter
    F0911 10:34:35.589993 8396 im2col.cu:59] Check failed: error == cudaSuccess (8 vs. 0) invalid device function
    *** Check failure stack trace: ***

    I tried installing Visual Studio 2015 Community and reinstalling CUDA 7.5 but it seems to want VS2013… I’ll have a look around and see if I can find somewhere to grab that.

    1. Hey there, are you using the new CUDA v7.5 version I posted? I just remembered that I think I compiled it with my specific compute capability (5.2) to see if it ran any better. I’ll recompile it with a more inclusive compute capability and post it when it’s done.

      1. Yes! I’m dreaming! Thanks for your help and hard work on this Brian.

        I got a few iterations before I got an ‘out of memory’ error, but I think I’ve read some stuff about sorting that out…

        F0923 15:42:23.015467 5036 syncedmem.cpp:51] Check failed: error == cudaSuccess (2 vs. 0) out of memory
        *** Check failure stack trace: ***

          1. Eek – bit of a delay there…

            Kind of – I had a look around again and found that it’s likely the ‘batch size’ according to the discussions I found via a Google search.

            The NVIDIA Quadro K600 in the PC I’m trying this on only has 1GB RAM, which is pretty low. I suspect that CAFFE has been written to run on higher specced GPU and so the batch size is too high. I’ve not got as far as finding where to change the batch size yet… I had a quick look. Got distracted…

          2. Al – I actually managed to sort this today by swapping out the example images images ‘flowers.jpg’ and ‘sky1024.jpg’ with my own (but smaller pixel dimensions)

  29. I have returned to upgrade and it seems that the results are somewhat different this time.

    The “distribution” works flawlessly for some reason, without any of the Nvidia CUDA DLLs that had to be in the same folder in the previous version. That’s version CUDA 7.5 with CUDNN 3. Perhaps this is due to the overall tidiness of the system.

    I can’t put a precise number, but it seems a bit slower than the previous CUDA version with the CUDNN. I copied that version into the new version. I can tell that the entire system is stuttering during computation, possibly indicating a solid performance. (yikes)

    Will you post your CUDNN version when you update it?

  30. As with *every* attempt I have made so far in trying to install DeepDream on my PC, both the zip-files I tried to download are corrupt. I can’t even count the number of programs I’ve worked with and successfully installed on my PC, but for some reason DeepDream has failed over, over and over again.

  31. Hey Brian,

    thanks for your instructions. The CPU only version works well. I tried to use the CUDA of my gtx 280. But i get some errors, which other mentioned here, too. Since the GTX280 supports CUDA Toolkit 6.5: Is it possible for you the upload a zip file for CUDA v. 6.5 which is supported by my card? Or give instructions how to build it on my own?

    Thanks in Advice
    DeepStuff

  32. Sorry I’m a bit of a newb – I want to use my own images as well as my own training data – how do I do this?
    Thanks!

    1. went to Anaconda 3.5 and it fixed THAT problem, but everything’s written in 2.7 so there’s syntax errors everywhere in the dream py itself

Leave a Reply

Your email address will not be published. Required fields are marked *