Solved by KFrank in post #2 
              
              
                Hello Fahad! 

When you use CrossEntropyLoss, your target y that you pass 
in to criterion must be integer class labels that take on values 
running from 0 to nClass - 1 (in your case, (0, 1, 2, 3, 4, 5)). 
If your class labels are originally (0, 5, 20, 40, 2.5, 10), you will 
have to remap them bef…