AttributeError:module tensorflow no attribute app解决办法
是因为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解决办法相关推荐
- 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\ ...
- AttributeError: module 'tensorflow' has no attribute 'Session'.解决办法
# 定义计算图 tens1 = tf.constant([1,2,3])# 创建一个会话 sess = tf.Session()# 使用这个创建好的会话来得到关心的运算的结果.比如可以调用 sess. ...
- AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘错误解决
AttributeError: module 'tensorflow' has no attribute 'Session'错误解决 根据网上教程安装tensorflow环境时,最后都会有个测试代码用 ...
- 解决tensorflow报错:AttributeError: module ‘tensorflow.keras.backend‘ has no attribute ‘get_session‘ 问题
欢迎大家关注笔者,你的关注是我持续更博的最大动力 原创文章,转载告知,盗版必究 解决tensorflow报错:AttributeError: module 'tensorflow.keras.back ...
- 成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
成功解决AttributeError: module 'tensorflow' has no attribute 'placeholder' 目录 解决问题 解决思路 解决方法 T1.降低tensor ...
- 成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘contrib‘
成功解决AttributeError: module 'tensorflow' has no attribute 'contrib' 目录 解决问题 解决思路 解决方法 解决方法
- 成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘get_variable‘
成功解决AttributeError: module 'tensorflow' has no attribute 'get_variable' 目录 解决问题 解决思路 解决方法 解决问题 Attri ...
- 成功解决AttributeError: module tensorflow has no attribute placeholder
成功解决AttributeError: module 'tensorflow' has no attribute 'placeholder' 目录 解决问题 解决思路 解决方法 解决问题 Attrib ...
- 成功解决AttributeError: module tensorflow has no attribute random_normal
成功解决AttributeError: module 'tensorflow' has no attribute 'random_normal' 目录 解决问题 解决思路 解决方法 解决问题 Attr ...
最新文章
- 2021年春季学期-信号与系统-第七次作业参考答案-第二小题
- 大家来聊聊如何PASS 360
- Ubuntu 14.04 文件服务器--samba的安装和配置
- angular和JAVA实现aes、rsa加密解密,前后端交互,前端加解密和后端JAVA加解密实现
- SGMII和RGMII入门学习
- 调用有道智云api做翻译器遇到播放音频的问题
- 点云最小二乘法拟合空间直线
- 多媒体(流媒体)技术领域及开源系统,媒体库数据如音乐、图片问题等-(图像,音视频)
- 图扑软件数字孪生汽车生产线,赋能智慧工厂科学运维
- div盒模型宽高计算
- word文档封面免费下载_为Word 2007文档添加封面
- 平价蓝牙耳机选哪个?盘点性价比高的无线蓝牙耳机
- Java的字节流和字符流
- 数据结构与算法—链表常见面试题(持续更新)
- 云服务器增加虚拟内存
- 说说我在机场碰上的那些大家喜闻乐见的事
- 朱清时看何谓大学生之“大”
- CSDN中写文章时,代码和注释的快速复制粘贴方法
- ricequant量化跟别的量化平台有什么不同?
- linux命令 mv -v,linux中的mv命令