I’m trying to do a frame by frame classification of some skeleton data using the torch.nn.NLLLoss().
The input is of size [batch_size, frames, features] and the network outputs logsoftmax values for each of the 12 classes for each of the frames so [batch_size, frames, classes=12]
I then want to compute the Negative Logliklihood Loss for this output based on the ground truth classes for each frame. At the moment the labels tensor is of size [batch_size, frames] where the second dimension contains the integer valued classes.
When I try to compute the loss I get the following error
ValueError: Expected target size (50, 12), got torch.Size([50, 175])

For a single example from a batch the loss seems to work but when I introduce the batch dimension it throws the above.
Any ideas on how to fix this would be greatly appreciated.
Cheers.