简体   繁体   中英

cannot import name 'theano_backend' from 'keras.backend'

I am trying to run the following:

from keras.backend import theano_backend

But I get this error:

Traceback (most recent call last):

  File "<ipython-input-64-39e623866e51>", line 1, in <module>
    from keras.backend import theano_backend

ImportError: cannot import name 'theano_backend' from 'keras.backend' (C:\Users\Dr. Sunil Singla\anaconda3\lib\site-packages\keras\backend.py)

I cloned this repo: https://github.com/titu1994/DenseNet.git and attempted to run it on my image data.

The latest Keras versions are just a wrapper on top of tf.keras, they are not the multi-backend keras you are expecting.

For this code to work, you should downgrade Keras to a version that is still multi-backend, like 2.2.x versions. I think 2.3.x still have multiple backends too, but versions 2.4 are TensorFlow only.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM