tensorflow各版本间的区别错误
来源:互联网 发布:少儿编程是什么意思 编辑:程序博客网 时间:2024/06/06 04:18
问题一:TypeError: Expected int32, got list containing Tensors of type ‘_Message’ instead.
tensorflow 函数tf.cocat([fw,bw],2)出错:
Expected int32, got list containing Tensors of type ‘_Message’ inst
查看原因是11版本的函数形式为:tf.concat(2,[fw,bw]),即应把串联的维度与串联值位置调换即可.
问题二:Input ‘split_dim’ of ‘Split’ Op has type float32 that does not match expected type of int32
This is because in Tensorflow versions < 0.12.0 the split function takes the arguments as:
x = tf.split(0, n_steps, x) # tf.split(axis, num_or_size_splits, value)
The tutorial you are working from was written for versions > 0.12.0, which has been changed to be consistent with Numpy’s split syntax:
x = tf.split(x, n_steps, 0) # tf.split(value, num_or_size_splits, axis)
问题三:TypeError: concat() got an unexpected keyword argument ‘axis’
tf.concat(concat_dim=axis, values=inputs, name=name)
修改为: tf.concat(inputs,1,name=name)
问题四:ValueError: ‘size’ must be a 1-D Tensor of 2 elements
img = tf.image.resize_images(img, new_shape[0], new_shape[1])
改为
img = tf.image.resize_images(img, new_shape)
问题五: ‘module’ object has no attribute ‘pack’
因为TF后面的版本修改了这个函数的名称,把 tf.pack 改为 tf.stack。
问题六:The value of a feed cannot be a tf.Tensor object. Acceptable feed values include Python scalars, strings, lists, or numpy ndarrays
数据集是feed输入的,feed的数据格式是有要求的
解决:img,label = sess.run[img,label],用返回值
问题七:AttributeError: ‘module’ object has no attribute ‘per_image_whitening’
For anyone else who has this problem, per_image_whitening was replaced by per_image_standardization in v0.12.
问题八:AttributeError: ‘module’ object has no attribute ‘image_summary’
tf.image_summary should be renamed to tf.summary.image;
问题九:AttributeError: ‘module’ object has no attribute ‘mul’
tf.mul(a,b) 这里的矩阵a和矩阵b的shape必须相等 tf.mul()是矩阵的element-wise相乘(即Hadamard乘积)
tf.matmul(a,b) 这里的矩阵a和矩阵b的shape应是a的行数对等与b的列数,tf.matmul()是矩阵的一般相乘。
解决:[tf.mul,tf.sub ] 和 [tf.neg] 不再使用,改为 [tf.multiply],[tf.subtract] 和 [tf.negative]。
问题十:AttributeError: ‘module’ object has no attribute ‘scalar_summary’
修改为:tf.summary.scalar(‘batch_loss’, loss)原因:新版本做了调整 …
- tensorflow各版本间的区别错误
- tensorflow版本的一些区别
- TensorFlow不同版本引起的错误
- TensorFlow不同版本引起的错误
- TensorFlow不同版本引起的错误
- TensorFlow不同版本引起的错误
- TensorFlow版本带来的concat错误
- tensorflow各版本间踩过的坑
- tensorflow各版本间踩过的坑
- tensorflow各版本间踩过的坑
- Tensorflow-gpu的错误
- TensorFlow中常见的由于API版本问题导致的错误汇总
- android版本的tensorflow 1.3
- Ubuntu16.04下安装配置了tensorflow GPU版本后导致的常见错误
- tensorflow 出现的奇怪错误
- tensorflow的tf.in_top_k()错误
- HDMI各版本的区别
- jdk各版本的区别
- 如何在 Azure 门户中将托管数据磁盘附加到 Windows VM
- 扁平化管理 hihoCoder[Offer收割]编程练习赛38/hihoCoder1650
- jxl导出数据到excel表格
- CentOS 7.0 使用 yum 安装 MariaDB 与 MariaDB 的简单配置
- Codeforces Round #448 (Div. 2) 895B. XK Segments
- tensorflow各版本间的区别错误
- JDBC往MySql数据库中写汉字出现乱码的问题
- Java中的方法重载
- 在OpenCV下利用霍夫变换进行直线检测和圆检测
- Visual Studio 2017 15.5 正式发布,性能再提升
- 【Scikit-Learn 中文文档】预测目标 (y) 的转换
- 使用POI同时对Excel文件进行读和写操作时避免Invalid header signatu
- Lintcode:旋转字符串
- REDIS系列之五大对象原理