Mike2004:

criterion = nn.MSELoss()


The below is the best I came up to reproduce your error. Adding .type(torch.FloatTensor) should fix your error.
label=torch.Tensor([0,1,2])
output=torch.Tensor(3,3)
criterion(label,torch.argmax(output,dim=1).type(torch.FloatTensor))

Output : tensor(1.)

If you remove that then it’s your error
Screen Shot 2020-05-17 at 12.07.03 PM1862×1332 365 KB