7029279:

What is kind of curious is that I have to do squeeze to get rid of one dimension before feeding it to GPU, which the original model did not have to do.


That sounds weird.
Which dimension are you squeezing and which shape does the target have before squeezing it?
The expected shape for a multi-class segmentation for the target is [batch_size, height, width] and the target tensor should contain the class indices in the range [0, nb_classes-1], if you are using nn.CrossEntropyLoss.