My laptop supports CUDA do I still need AWS set up?

Sorry, It was a syntax error. Running OK now.

1 Like

Shawn,

I installed Keras successfully. However on running the example python mnist_cnn.py it looks like it is looking for tensorflow instead of theano. Is there any other example which calls theano instead of thensorflow ? The bash output is as follows:

$ python mnist_cnn.py
Using TensorFlow backend.
Traceback (most recent call last):
** File “mnist_cnn.py”, line 12, in **
** from keras.datasets import mnist**
** File “C:\Users\TAPASHETTI-SR\toolkits\anaconda2-4.2.0\lib\site-packages\keras-1.1.0-py2.7.egg\keras_init_.py”, line 2, in **
** from . import backend**
** File “C:\Users\TAPASHETTI-SR\toolkits\anaconda2-4.2.0\lib\site-packages\keras-1.1.0-py2.7.egg\keras\backend_init_.py”, line 64, in **
** from .tensorflow_backend import ***
** File “C:\Users\TAPASHETTI-SR\toolkits\anaconda2-4.2.0\lib\site-packages\keras-1.1.0-py2.7.egg\keras\backend\tensorflow_backend.py”, line 1, in **
** import tensorflow as tf**
ImportError: No module named tensorflow

I’ve found another technology stack that’s a bit more recent that works for:

Windows 10 / Visual Studio 2015 / Python 2.7 / Anaconda 4.2.0 / Cuda 8.0.44 / MinGW-w64 5.4.0 / Theano 0.8.2 / Keras 1.1.0 / OpenBlas 0.2.14 (optional) / cuDNN 5.1 (conditional for convolution neural networks)

https://github.com/glyphx/dlwin/blob/master/README.md6 <- I mainly used these instructions, perhaps I will modify them to reflect a few of the idiosyncrasies I found.

http://ankivil.com/installing-keras-theano-and-dependencies-on-windows-10/4 <-- this helped me solve a few problems with the first link.

Namely to modify %USERPROFILE%/.keras/keras.json so that keras uses theano instead of tensorflow:
keras.json

{
“floatx”: “float32”,
“epsilon”: 1e-07,
“image_dim_ordering”: “th”,
“backend”: “theano”
}

I also had memory issues, we’ll see if that goes away when I get my own TitanXP on weds, muhahaha! To resolve the memory problems I had to pass new parameters to THEANO_FLAGS. The author has lib.cnmem=0.8, I had to lower mine to .7 or .65 to avoid crashing or slowdown.

My environment: https://gist.github.com/glyphx/0dd774b25f5ad63fbcbe10a205992d1a3

https://drive.google.com/file/d/0B7OZ3ORJZNOISE95SnIxeFRBa1U/view?usp=sharing1

Somehow I matched the author’s speed results, his titan, vs my 980: https://gist.github.com/glyphx/74dfce1a1736b8d669614a5570db8f863

If anyone implements this and has questions feel free to ask, I think I have a decent working understanding now.

Now that I finally have my environment set and I understand a bit more python it’s time to re-watch the first lessons and implement!

Just grabbed my post from that other thread, yes I did notice that issue as well, then later noticed Jeremy actually mentions it in the video, but follow the instructions above to modify keras.json

The .json folder and the keras.json file within it must be created in c:/toolkits or in c:/toolkits/keras-1.1.0 ?

OK, got it. It is in ~.

Thanks a ton Shawn for all the support and answering all my questions patiently. I am through with the setup at last.

1 Like

Yeah, sorry I wasn’t more clear. Do note that %USERDATA% and ~ are the same thing in this instance.

Are there any additional steps in order to run the jupyter notebooks of the course ?

Not really, just go to the directory you want to run a notebook in, and type jupyter notebook. Doing this will start a browser session with jupyter. You can also use a plugin for pycharm and I think there is one for atom. You can issue the command jupyter notebook --no-browser to get a key, this is sometimes useful when you’re using an ide and just need the token. It seems to run the smoothest in it’s natural browser setting. Remember to start jupyter notebook through mingw, not cmd/powershell that way you can use ! commands for the bash shell. I also use the ‘dark reader’ chrome addon when using jupyter, cause it makes it look very pretty. :smiley:

1 Like

I am attempting Lesson 1 now. wget http://www.platform.ai/data/dogscats.zip when issued through git bash returns
wget command not found. Is there anything I am missing?

Shawn,

I am almost through with lesson 1. However I am getting the following error while executing vgg.predict(imgs, True):

WindowsError: [Error 3] The system cannot find the path specified: ‘C:/toolkits/openblas-0.2.14-int32/bin/.’

However the path should have been

“C:\Users\TAPASHETTI-SR\toolkits\openblas-0.2.14-int32\bin” according to my setup. Looks like the path C:/toolkits… is hardcoded somewhere.

How can I overcome this?

Should I copy the toolkits directory under C:

I think that is not the solution as all the PATH definitions will be wrong in the environment. I am stuck !!:tired_face:

Shawn,

I don’t know how but the notebook started working without error after restarting the laptop.
However, GPU is not being used. As covered in the video, I could find a theanorc file in “C:…\toolkits\keras-1.1.0\docker\theanorc” with the following content:

[global]
floatX = float32
optimizer=None
device = gpu

I also tried setting the THEANO_FLAGS=THEANO_FLAGS_GPU.
The GPU is not being used. Please help me to resolve this.

reinstall from scratch would be my suggestion, I have no idea what was modified and there isn’t much information I can go on. Note that openblas isn’t exactly needed. It’s not in Jeremy’s default install. I would also recommend not deviating from the suggested path until you fully understand all the interactions.

Is the location of my theanorc file correct or it should be in the toolkits dir or home dir of mingw?

Maybe you’ve switched users on your windows pc? or have you modified your user accounts?

you should have a .keras folder in your home directory with the keras.json file

This is how my toolkits folder looks:

Further this is how the keras 1.1.0 folder looks:

If reinstalling is the only option, should I start by uninstalling Visual Studios followed by Anaconda etc. In case of Theano and Keras openBlas and Cuda can I just delete all these folders from toolkits dir ?