谷歌搜索这会让你无处可去,所以我决定通过将其发布为可搜索的问题来帮助未来的我和其他人。
def __init__():
...
self.val_acc = pl.metrics.Accuracy()
def validation_step(self, batch, batch_index):
...
self.val_acc.update(log_probs, label_batch)
给
ValueError: preds and target must have same number of dimensions, or one additional dimension for preds
为log_probs.shape == (16, 4)
和为label_batch.shape == (16, 4)
有什么问题?