Hello Paulo,
Should the number of classes be equal to the number of channels as given here in your code snippet?
NLLloss2d 106
I have a similar problem statement where each of my pixels at the end of the convolution layer should have a label between (0-9). I wonder, shouldn’t NLLloss2d work for you as well?
Regards
Surojit