Check the shape of the target tensor passed to nn.CrossEntropyLoss as it seems to contain an unnecessary dimension.
For a multi-class classification using nn.CrossEntropyLoss the model output should have the shape [batch_size, nb_classes] containing the logits and the target should have the shape [batch_size] containing the class indices in the range [0, nb_classes-].