You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
First I got a ValueError: Using a target size (torch.Size([64])) that is different to the input size (torch.Size([64, 1])) is deprecated. Please ensure they have the same size.
Then I altered y_pred to y_pred.squeeze().detach(), but I got a new error showing element 0 of tensors does not require grad and does not have a grad_fn where in line 93, loss.backward().
So can you help me? what should I do?
The text was updated successfully, but these errors were encountered:
Text-Classification-LSTMs-PyTorch/main.py
Line 89 in 2f8bada
Hello,
First I got a ValueError: Using a target size (torch.Size([64])) that is different to the input size (torch.Size([64, 1])) is deprecated. Please ensure they have the same size.
Then I altered y_pred to y_pred.squeeze().detach(), but I got a new error showing element 0 of tensors does not require grad and does not have a grad_fn where in line 93, loss.backward().
So can you help me? what should I do?
The text was updated successfully, but these errors were encountered: