Solved by Caruso in post #2 
              
              
                Hi, 
if your model outputs 4 classes, CrossEntropyLoss expects your class labels to be in the range [0,C−1], so in this case [0, 3]. Can you make sure your labels are in this range?