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