tensorflow 函数tf.cocat([fw,bw],2)出错:
Expected int32, got list containing Tensors of type ‘_Message’ inst
查看原因是11版本的函数形式为:tf.concat(2,[fw,bw]),即应把串联的维度与串联值位置调换即可.
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)
tf.concat(concat_dim=axis, values=inputs, name=name)
修改为: tf.concat(inputs,1,name=name)
img = tf.image.resize_images(img, new_shape[0], new_shape[1])
改为
img = tf.image.resize_images(img, new_shape)
因为TF后面的版本修改了这个函数的名称,把 tf.pack 改为 tf.stack。
数据集是feed输入的,feed的数据格式是有要求的
解决:img,label = sess.run[img,label],用返回值
For anyone else who has this problem, per_image_whitening was replaced by per_image_standardization in v0.12.
tf.image_summary should be renamed to tf.summary.image;
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]。
修改为:tf.summary.scalar(‘batch_loss’, loss)原因:新版本做了调整 …