如果装的是tf2的话,可能是tf2的问题?
把:

import tensorflow as tf

改成:

import tensorflow.compat.v1 as tf

有需要的话还可以补个:

tf.disable_v2_behavior()

AttributeError: module ‘tensorflow‘ has no attribute ‘xxx‘相关推荐

  1. AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘错误解决

    AttributeError: module 'tensorflow' has no attribute 'Session'错误解决 根据网上教程安装tensorflow环境时,最后都会有个测试代码用 ...

  2. AttributeError: module 'tensorflow' has no attribute 'random_normal'

    执行<TensorFlow实战Google深度学习框架(第2版)>only源代码 CH3 时如下语句报错 batch_size = 8 w1= tf.Variable(tf.random_ ...

  3. 问题解决——AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘

    问题解决--AttributeError: module 'tensorflow' has no attribute 'placeholder' 参考文章: (1)问题解决--AttributeErr ...

  4. 问题:AttributeError: module 'tensorflow' has no attribute 'gfile'

    目录 问题 原因与解决方案 解决方案1 解决方案2 问题 运行如下代码 if not tf.gfile.exists(DATA_DIRECTORY):tf.gfile.makedirs(DATA_DI ...

  5. tensorflow版本问题导致的错误AttributeError: module ‘tensorflow‘ has no attribute ‘***‘

    问题解决--AttributeError: module 'tensorflow' has no attribute 'placeholder' - yuanyuanWu11 - 博客园 tensor ...

  6. 成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘

    成功解决AttributeError: module 'tensorflow' has no attribute 'placeholder' 目录 解决问题 解决思路 解决方法 T1.降低tensor ...

  7. 成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘contrib‘

    成功解决AttributeError: module 'tensorflow' has no attribute 'contrib' 目录 解决问题 解决思路 解决方法 解决方法

  8. 成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘get_variable‘

    成功解决AttributeError: module 'tensorflow' has no attribute 'get_variable' 目录 解决问题 解决思路 解决方法 解决问题 Attri ...

  9. 成功解决AttributeError: module tensorflow has no attribute placeholder

    成功解决AttributeError: module 'tensorflow' has no attribute 'placeholder' 目录 解决问题 解决思路 解决方法 解决问题 Attrib ...

最新文章

  1. 解析gui-config.json出差_LUA解析json小demo
  2. 用于判断用户注册时,密码强度的JS代码。
  3. 带你走进网站分析的世界!
  4. python二维码生成器制作中报错为oserror_Python生成:OSError:[WinError 193]%1不是有效的Win32应用程序...
  5. 主键索引 or 辅助索引?一文告诉你 Mysql limit 优化时的索引选择!
  6. Java GregorianCalendar hashCode()方法与示例
  7. JavaScript RegExp(正则表达式) 对象
  8. html登录页面的校验控件,HTML5一款有趣智能的密码输入界面控件
  9. 深入浅出学习Hibernate框架(二):JDBC基础操作
  10. eventlog analyzer 8.0
  11. 第十二章 网络搭建及训练
  12. HTML+CSS+JS实现 ❤️3D旋转魔方图片相册特效❤️
  13. 正弦余弦优化算法[记录]
  14. Jetty开发的相关
  15. word+Endnote参考文献对齐设置设置流程
  16. 股权激励,要从这六个层面去理解
  17. centos 7 安装snmp
  18. JMeter Sampler之BeanShellSampler的使用
  19. Unity新手适合的简单AI
  20. 磊科nw336+linux驱动程序,磊科nw336无线网卡驱动,详细教您磊科nw336无线网卡驱动...

热门文章

  1. 陕西师范大学计算机学院课表,陕西师范大学数学和信息科学学院课程表.doc
  2. php7.0不出结合项,帝国CMS结合项提示“您来自的链接不存在”
  3. rpm安装mysql5.6.37_MySQL之—RPM方式安装MySQL5.6 代码实例详解
  4. Mac Os 安装github上的开源软件
  5. 第三方库自动安装脚本(复习)
  6. linux命令cd回退_Linux命令一
  7. python35安装教程_python详细安装教程,非常值得看的一篇文章
  8. OpenCV:使用python-cv2实现视频的分解与合成
  9. AcWing 103. 电影
  10. Paper and Codes Leaderboard