Urgent-Please help! - Using tensorflow instead of theano


I have tensorflow already in my system. I wanted to ask, since I have tensorflow can I not proceed with this VGG part and this entire deeplearning series? I see in the utils.py there are import theano hence I cannot run it on my system.

How can I proceed with this and the entire tutorial if anyone can throw some light in it.

Much thanks in advance!


Anybody out there to reply me? I am waiting for an answer and help.

Why you cannot run theano on your system?

@ecdrid - because Theano will stop its support after is 1.0 release. Start saying goodbye to Theano now and Hello to Tensorflow.


1 Like

@prady89 the next version of the Fast.ai course is switching to PyTorch — some things you could try:

  • just install Theano for now, don’t worry about it! It’s just a backend with Keras - you don’t interact with it.

  • use it as an opportunity to refactor the existing Keras 1 code to support Tensorflow — it’s mostly flipping dimensions & such - (3, 224, 224) -> (224, 224, 3)

  • if you really want to get ahead — follow along with the current Part 1 videos in PyTorch. the principles are mostly the same, and it will give you a better understanding of what’s happening :slight_smile:

I got stuck getting Theano working and gave up. I found setting up Tensorflow to be much easier.

  1. Change the keras json file to use tensor flow

  2. Comment out the theano imports in the utils.py

  3. You’ll need to install tensorflow-gpu if you haven’t already to utilize your gpu.

1 Like

Theano does not support the latest nVidia drivers, there are incompatibilities in the C++ level of code which is very unlikely to be fixed since Theano development has officially stopped.

Using Tensorflow is easy comapared to theano. Mostly you will not notice the difference as Keras handles the backend.

Use "tensorflow-gpu" for the GPU version.

To anyone using Tensorflow on windows as a backend. Were you able to reach a precision of around 97% in lesson 1? I get stuck around 90%. I describe my problem and everything I tried in great details in this post (but I cross reference it here because I think it was not a good thread to post in).

Thanks for any insight!


Hi, I had the same issue - the problem is that theano and tensorflow use different kernel formats and you have to convert them (I think it just transposes the matrices) as the model that is loaded uses the theano format.

I called convert_all_kernels_in_model(model) as the last line of the create() method (and imported the function of course - from keras.utils.layer_utils import convert_all_kernels_in_model) and now i get >97% accuracy.