Solved by ptrblck in post #2 
              
              
                Based on the docs the output of the model should have the shape [batch_size, nb_classes, *], while the target should have the shape [batch_size, *], so you would need to permute the output to the shape [batch_size=3, nb_classes=nb_tokens=136, seq_len=14] (assuming 136 equals the number of classes).  …