- UserWarning: Using a target size (torch.Size([98, 1, 1])) that is different to the input size (torch.Size([98, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size. return F.mse_loss(input, target, reduction=self.reduction)
【问题原因】 -1)问题代码如下:
loss_func = nn.MSELoss()
loss = loss_func(y_pred, y_label)