keras module 'tensorflow.python.keras.backend' has no attribute 'get_graph'

今天在运行kreas的时候,出现了下面的错误:

 File "/home/eric/anaconda3/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 9, in 
    from .. import backend as K
  File "/home/eric/anaconda3/lib/python3.6/site-packages/keras/backend/__init__.py", line 1, in 
    from .load_backend import epsilon
  File "/home/eric/anaconda3/lib/python3.6/site-packages/keras/backend/load_backend.py", line 90, in 
    from .tensorflow_backend import *
  File "/home/eric/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 54, in 
    get_graph = tf_keras_backend.get_graph
AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'

我就去查了一下我的keras版本是2.3

解决方法

pip install keras==2.2.0

参考文献

[1]. 导入keras报错:module 'tensorflow.python.keras.backend' has no attribute 'get_graph'. https://blog.csdn.net/qq_42823242/article/details/101717247

 

你可能感兴趣的:(keras)