ML0401:

The indexing of the labels should start with 0 and end with the number of classes - 1. Is this correct?


Yes, nn.CrossEntropyLoss as well as nn.NLLLoss expects the target tensor to be a LongTensor containing the class indices in the range [0, nb_classes-1].