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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM