Solved by ptrblck in post #5 
              
              
                Thanks for the update. 
Could you check the target min and max value before passing it to nn.CrossEntropyLoss or nn.NLLLoss? 
The expected values are in the range [0, nb_classes-1], while you might pass out of bounds values. 
You could also run the code on the CPU, which should give you a better sta…