0
我正在将张力值中的标签值反馈给张量流。我batchsize是的,我有类3次数:ValueError:无法为张量馈送形状(57,1)的值
x = tf.placeholder(tf.float32,[None,457)],name='Train_data')# each input has a length of 457
y_ = tf.placeholder(tf.float32,[None,numberOFClasses],name='Labels')#
.........................................................................
for j in range(len(batch_xs[0])-1):# this is the input data which is fine
print(sess.run(train_step,feed_dict={x:batch_xs[j],y_:np.reshape(batch_ys[j] ,(batchSize,1))}))
的代码是好的数据也蛮好唯一的问题是标签Y_
这里的形状是什么,我得到
ValueError: Cannot feed value of shape (57, 1) for Tensor 'Labels:0', which has shape '(?, 19)'
和size of batch_ys[i] is 57
我看到它的方式是我,如果57 = 3*19=3*number of classes.
所以我Y_应该有57
标签中有一个批次的大小?任何想法这里有什么问题?
非常感谢回复,但还是不明白?如果我有57个批次(57个样本数据),我需要3 * 19个类来标记它?对? – Engine
是的,您需要每个样品一个标签,所以如果您的批次中有57个输入样品,则需要57个标签。 – tony