'tensorflow' has no attribute 'sub'
'tensorflow' has no attribute 'sub'
在学习tensorflow的时候,照到官方的例子做,发现了一个:
# 进入一个交互式 TensorFlow 会话.
import tensorflow as tf
sess = tf.InteractiveSession()x = tf.Variable([1.0, 2.0])
a = tf.constant([3.0, 3.0])# 使用初始化器 initializer op 的 run() 方法初始化 'x'
x.initializer.run()# 增加一个减法 sub op, 从 'x' 减去 'a'. 运行减法 op, 输出结果
sub = tf.sub(x, a)
print sub.eval()
# ==> [-2. -1.]
AttributeError: module 'tensorflow' has no attribute 'sub'
估计是函数换名字了,果然换成 subtract 就可以了。
'tensorflow' has no attribute 'sub'相关推荐
- AttributeError: module ‘tensorflow‘ has no attribute ‘Session‘错误解决
AttributeError: module 'tensorflow' has no attribute 'Session'错误解决 根据网上教程安装tensorflow环境时,最后都会有个测试代码用 ...
- AttributeError: module 'tensorflow' has no attribute 'random_normal'
执行<TensorFlow实战Google深度学习框架(第2版)>only源代码 CH3 时如下语句报错 batch_size = 8 w1= tf.Variable(tf.random_ ...
- tf2.0环境下“module ‘tensorflow‘ has no attribute ‘log‘”的解决办法
写在这里的初衷,一是备忘,二是希望得到高人指点,三是希望能遇到志同道合的朋友. 目录 一.问题 二.根本原因 三.解决办法 方法一 方法二 一.问题 目前,尝试着通过tensorflow对医学图像进行 ...
- 问题解决——AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
问题解决--AttributeError: module 'tensorflow' has no attribute 'placeholder' 参考文章: (1)问题解决--AttributeErr ...
- 问题:AttributeError: module 'tensorflow' has no attribute 'gfile'
目录 问题 原因与解决方案 解决方案1 解决方案2 问题 运行如下代码 if not tf.gfile.exists(DATA_DIRECTORY):tf.gfile.makedirs(DATA_DI ...
- module ‘tensorflow‘ has no attribute ‘Tensor‘
module 'tensorflow' has no attribute 'Tensor' import tensorflow as tftf.compat.v1.Session()from typi ...
- module 'tensorflow' has no attribute 'Session'
AttributeError: module 'tensorflow' has no attribute 'Session'错误解决 原创陆羽飞 最后发布于2019-10-07 13:32:07 阅读 ...
- keras module 'tensorflow' has no attribute 'placeholder'
keras module 'tensorflow' has no attribute 'placeholder' pip install tensorflow-gpu==1.13.1 keras=2. ...
- tensorflow版本问题导致的错误AttributeError: module ‘tensorflow‘ has no attribute ‘***‘
问题解决--AttributeError: module 'tensorflow' has no attribute 'placeholder' - yuanyuanWu11 - 博客园 tensor ...
- 成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
成功解决AttributeError: module 'tensorflow' has no attribute 'placeholder' 目录 解决问题 解决思路 解决方法 T1.降低tensor ...
最新文章
- KS103超声波测距模块
- ELK 性能优化实践
- poj2409(纯Polya定理)
- 模板 - 数学 - 数论 - 莫比乌斯反演 - 2
- 【数据结构与算法】之有关“跳跃游戏”的求解思路与示例算法
- java-初识JVM的内存分配(5个区域)概念--系列(一)
- Bash字符串处理(与Java对照) - 17.判断是否以另外的字符串结尾
- github 国内加速镜像
- Intel Haswell/Broadwell架构/微架构/流水线 (3)-流水线乱序引擎
- java 输出一个爱心_java基础 之 几个常用的类
- jQuery--checkbox全选/取消全选 及checkbox遍历
- android开机自动打开微信小程序,Android应用启动微信小程序
- 计算机应用免费课件,计算机应用基础ppt课件 免费版
- 多尺度卷积稀疏编码的无监督迁移学习
- ios safari 模拟器_iOS 模拟器调试大法了解一下?
- php 同比增长率上期未0,同比增长率计算时,上期值为0怎么计算?
- IPhone 日历提醒
- windows系统清除电脑地址栏文件(夹)路径
- Java面试集合(四)
- 那些好玩的生成器网站(二)