AttributeError: module ‘tensorflow’ has no attribute 'get_variable

下载了关于手写数字识别的代码,代码没有错误,但是显示以上错误

  1. 原因 :代码是基于tensorflow1.0的
  2. 但是我运行的环境安装的是anacondar下安装的tensorflow2.0(下载时自动下载最新版的)
  3. tensorflow两个版本差距很大

引用文本
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

可以解决所有因为版本问题出现的问题
参考:大型翻车现场,升级到tensorflow 2.0,我整个人都不好了

AttributeError: module 'tensorflow' has no attribute 'get_variable相关推荐

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

最新文章

  1. 安装firefox 3.6.4 (ubuntu 10.04)
  2. Java-JPA:JPA
  3. 【转】分布式一致性算法:Raft 算法(Raft 论文翻译)
  4. Spring-学习笔记03【Spring的IOC和DI】
  5. php重置下标有什么用,怎么在PHP中删除空数组并重置数组键名
  6. BZOJ-1057: [ZJOI2007]棋盘制作(单调栈)
  7. 使用SELECT 和OPEN CURSOR 读取big table的性能比较
  8. 难题:嵌套computeIfAbsent
  9. leetcode-92-反转链表②
  10. 前端学习(2037)vue之电商管理系统电商系统之优化
  11. CSDN登陆校验码模式识别程序
  12. .htaccess必须以ASCII模式上传
  13. SQLServer之修改CHECK约束
  14. 百练 2972 确定进制 解题报告
  15. Omi命令行界面omi-cli发布
  16. [NOIP2017 TG D2T2]宝藏(模拟退火)
  17. centos6.8安装mysql5.6【转】
  18. 武忠祥<高等数学辅导讲义> 第一章
  19. 计算机编程语言排行榜—TIOBE世界编程语言排行榜(2020年6月份最新版)
  20. java调用python库pyd_Java怎么调用pyd文件

热门文章

  1. [实践篇]13.21 la qcom watchdog学习笔记
  2. 自动驾驶系统(博世)- 冗余设计解析【附PDF参考资料下载】
  3. SuspendThread和ResumeThread函数
  4. 基于摄像头的简单手势控制系统
  5. 关于如何选择Bloger托管商
  6. 佛洛依德算法原理讲解
  7. coreldraw x5 选择工具快捷键_coreldraw x5快捷键大全 coreldraw快捷键大全
  8. Java for Web学习笔记(一一八):【篇外】Soap client
  9. 复旦大学计算机系学生,对复旦大学计算机系数据库课程的评价.doc
  10. 网络围棋 v1.10 怎么用