前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >module ‘tensorflow‘ has no attribute ‘get_default_graph‘

module ‘tensorflow‘ has no attribute ‘get_default_graph‘

作者头像
狼啸风云
修改2022-09-02 20:17:39
修改2022-09-02 20:17:39
1.9K00
代码可运行
举报
运行总次数:0
代码可运行

module 'tensorflow' has no attribute 'get_default_graph'

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

解决办法,降级TensorFlow和keras

代码语言:javascript
代码运行次数:0
复制
pip uninstall tensorflow # 卸载tf

pip uninstall keras # 卸载keras

安装1.2.0的tf 和 2.0.9的keras

代码语言:javascript
代码运行次数:0
复制
pip install tensorflow==1.2.0

pip install keras==2.0.9
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/12/18 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • module 'tensorflow' has no attribute 'get_default_graph'
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档