I have such shape now of input and target as before:
tensor([4, 4, 4, 4, 4, 4, 4, 4, 4, 4])
torch.Size([10]) #this is input
tensor([4, 3, 0, 0, 1, 0, 2, 1, 3, 2])
torch.Size([10]) #this is target
I apply log_softmax to my output logits indeed:
///
y_pred = self.fc4(out3)
return F.log_softmax(y_pred)
…and transform input, target as follows in training loop:
input:
output = model(x_train)
output = torch.argmax(output, dim=-1)
target:
y_train = y_train.squeeze_(1)
y_train = torch.transpose(y_train, 0, -1)
what I get, is following error now:

Screenshot 2019-05-11 at 22.36.24.png2040×1406 396 KB