module 'tensorflow' has no attribute 'get_default_graph'

module 'tensorflow' has no attribute 'get_default_graph'

当我使用keras和tensorflow做深度学习的时候,python3.6报了这个错误,这个问题源自于keras和TensorFlow的版本过高导致模块不存在或者已经更改不再兼容

解决办法,降级TensorFlow和keras


pip uninstall tensorflow # 卸载tf

pip uninstall keras # 卸载keras

安装1.2.0的tf 和 2.0.9的keras

pip install tensorflow==1.2.0

pip install keras==2.0.9
posted @ 2019-03-28 20:15  devilyouwei  阅读(13529)  评论(0编辑  收藏  举报