Solved by ptrblck in post #2 
              
              
                No, the sizes are wrong as nn.NLLLoss expects the model output to have the shape [batch_size, nb_classes, seq_len] and a target of [batch_size, seq_len] for a temporal multi-class classification. 
permute the model output and it should be working.