Why keras always says using theano backend?

692 views Asked by At

I installed keras using conda in my virtual environment and checked $HOME/.keras/config.json file.

    {
    "image_data_format": "channels_last",
    "epsilon": 1e-07,
    "floatx": "float32",
    "backend": "tensorflow"
}

I already set backend to tensorflow but when I run this in the python console

import keras

It is showing me that keras is using theano backend. Why?

Using Theano backend.
WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named mkl

I added export KERAS_BACKEND=tensorflow at the end of my .bashrc and restart the command line and activate my source. Still seeing the above error again. Can anyone help me with this?

2

There are 2 answers

0
Nikhila Haridas_Intel On

We had also faced the same issue when installed keras using conda environment. Since we already had keras installed using pip, where the backend was set as theano, it was taking that keras. The problem got fixed when we removed the pip version of keras using the command pip uninstall keras

0
Shivam Sood On

Well you can start your editor with line:

KERAS_BACKEND=tensorflow

KERAS_BACKEND=tensorflow spyder 

This would force use the Tensorflow backend. But before using this ensure that you have tensorflow installed with all the required dependencies.

Source