dbld_blqq:

Hi, I face the same problem as Naveen, shape of my output is torch.Size([1, 20, 4]), where 20 is the time sequence, 4 is the number of classes


That would be wrong as explained here:



 ptrblck:

nn.CrossEntrolyLoss expects a model output in the shape [batch_size, nb_classes, *additional_dims] and a target in the shape [batch_size, *additional_dims] containing the class indices in the range [0, nb_classes-1].


so you would have to permute the model output such that the class dimension is in dim1.



 dbld_blqq:

softmax was used as the final activitation function, and loss is nn.CrossEntropyLoss()


That is unfortunately also wrong, since nn.CrossEntropyLoss expects logits, so you would have to remove the softmax.