因为softmax_cross_entropy_with_logits
传入的labels
要是one-hot的,
labels
和logits
的shape相同
转化方法:
labels_onehot = tf.one_hot(input_y, num_classes)
input_y
是[batch_size]的shape
因为softmax_cross_entropy_with_logits
传入的labels
要是one-hot的,
labels
和logits
的shape相同
转化方法:
labels_onehot = tf.one_hot(input_y, num_classes)
input_y
是[batch_size]的shape