运行模型时出现此ValueError错误:
ValueError: Can not squeeze dim[1], expected a dimension of 1, got 18000 for 'sparse_softmax_cross_entropy_loss/remove_squeezable_dimensions/Squeeze' (op: 'Squeeze') with input shapes: [?,18000].
触发错误的位置是:
logits = model(image, training=True)
loss = tf.losses.sparse_softmax_cross_entropy(labels=labels, logits=logits)
accuracy = tf.metrics.accuracy(
labels=labels, predictions=tf.argmax(logits, axis=1))
调用sparse_softmax_cross熵函数时出现错误。我正在使用的图片尺寸为(50,120,3)。关于如何解决该问题的任何线索吗?