Open jiapei100 opened 6 years ago
I ran into the same issue, guessing this happened from a recent update in pytorch
. @jiapei100
A solution, though I am sure this is not the best way, was adding this before line 78
label = label.unsqueeze(0)
Is this a better solution? Adding this after line 19
@hunkim
y_data = [[y] for y in y_data]
I guess another possible solution is to replace the original label at line 78 with torch.LongTensor([label]).
line 78 of 12_2_hello_rnn.py What's wrong with it?
loss += criterion(output, label)