是因为tensorflow版本问题,如果没猜错的话你用的应该是tensorflow2.0,而源代码是tensorflow1.几版本。所以有错误。

解决办法:(1)将import tensorflow as tf 改为import tensorflow.compat.v1 as tf

        (2)用tf.compat.v1.flags替换tf.app.flags

这两种方法都可以。个人推荐第一种。

如果两种方法都试了还没有解决问题,只好拿出必杀技了,下载pycharm,选择python版本,在pycharm里面为python创建对应的虚拟环境,如果原来是tensorflow2.0版本卸载掉,安装tensorflow 1.x版本。记得勾选specific version 才可以安装。 

AttributeError:module tensorflow no attribute app解决办法相关推荐

  1. Tensorflow——[AttributeError:module tensorflow no attribute app]解决方案

    问题描述 import tensorflow as tf FLAGS = tf.app.flags.FLAGS File "E:\CNN\chengxu\SVM-CNN-12.22\lib\ ...

  2. AttributeError: module 'tensorflow' has no attribute 'Session'.解决办法

    # 定义计算图 tens1 = tf.constant([1,2,3])# 创建一个会话 sess = tf.Session()# 使用这个创建好的会话来得到关心的运算的结果.比如可以调用 sess. ...

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

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

  4. 解决tensorflow报错:AttributeError: module ‘tensorflow.keras.backend‘ has no attribute ‘get_session‘ 问题

    欢迎大家关注笔者,你的关注是我持续更博的最大动力 原创文章,转载告知,盗版必究 解决tensorflow报错:AttributeError: module 'tensorflow.keras.back ...

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

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

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

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

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

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

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

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

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

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

最新文章

  1. 2021年春季学期-信号与系统-第七次作业参考答案-第二小题
  2. 大家来聊聊如何PASS 360
  3. Ubuntu 14.04 文件服务器--samba的安装和配置
  4. angular和JAVA实现aes、rsa加密解密,前后端交互,前端加解密和后端JAVA加解密实现
  5. SGMII和RGMII入门学习
  6. 调用有道智云api做翻译器遇到播放音频的问题
  7. 点云最小二乘法拟合空间直线
  8. 多媒体(流媒体)技术领域及开源系统,媒体库数据如音乐、图片问题等-(图像,音视频)
  9. 图扑软件数字孪生汽车生产线,赋能智慧工厂科学运维
  10. div盒模型宽高计算
  11. word文档封面免费下载_为Word 2007文档添加封面
  12. 平价蓝牙耳机选哪个?盘点性价比高的无线蓝牙耳机
  13. Java的字节流和字符流
  14. 数据结构与算法—链表常见面试题(持续更新)
  15. 云服务器增加虚拟内存
  16. 说说我在机场碰上的那些大家喜闻乐见的事
  17. 朱清时看何谓大学生之“大”
  18. CSDN中写文章时,代码和注释的快速复制粘贴方法
  19. ricequant量化跟别的量化平台有什么不同?
  20. linux命令 mv -v,linux中的mv命令

热门文章

  1. 【转】直线光栅化算法-Bresenham算法
  2. 18、Page Object 设计模式
  3. .net core项目实战之开发环境搭建
  4. [Python]从零开始学python——Day03 字典,元组
  5. Web开发系列 - JSON
  6. Mac下安装及使用rz、sz远程上传下载文件
  7. Kotlin教程学习-数据类型
  8. 转载:JAVA 操作 Ant API
  9. 借助树的概率dp(期望)+数学-好题-hdu-4035-Maze
  10. 如何利用jquery实现一句话全选/取消全选的实例代码