maxmatical:

Using a target size (torch.Size([128])) that is different to the input size (torch.Size([128, 1, 1, 1])) is deprecated


That’s your answer. You need to change the target size (i.e., the label size) to be 128,1,1,1
So for example,
target = target.view(-1,1,1,1)