Search code examples
kerastheanogoogle-colaboratory

Setting Google Colab to use Theano as Backend


I'm following an online tutorial which uses Theano as backend. I am using Google Colab which defaults to Tensorflow as backend.

How can we switch to using Theano as backend? Thanks


Solution

  • This will help,

    import os
    os.environ["KERAS_BACKEND"] = "theano"
    import keras.backend
    keras.backend.set_image_dim_ordering('th')