Solved by ptrblck in post #21 
              
              
                Your target is probably all zeros. 
I would recommend to avoid narmalizing the target and rescaling it again. Instead just keep the class indices and remove the transformation for your target. 
If you call target.long() on small numbers, they will be all zeros. Scaling with 255 won’t change that. 
A…