Thank you for repsonding.
This exception is thrown when calculating the loss though. You think what I’m passing to the loss function is correct, but the output of my network isn’t ?
I’ll try to change my code accordingly and see if it helps.
/edit: Sadly I’m still getting the exception, just a slightly different one:
ValueError: Expected target size (5, 96), got torch.Size([5, 10])

The Error makes sense to me. I get that I’m passing in values one-hot-encoded (96) as input, and I’m passing them as non-one-hot-encoded indices as target but from everything I read, I thought that’s what I’m supposed to be doing and so I have no clue how to resolve it.
Is this assumption not correct?
I’m really lost here.
/Edit:
Okay, I think I found the solution:
loss = criterion(y_hat.permute(0, 2, 1), target)

No more exception.
Is this correct ?
What happens to the third dimension of the input? Is it just ignored?