Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in 13_3_char_rnn.py #46

Open
KawhiZhao opened this issue May 15, 2019 · 0 comments
Open

Error in 13_3_char_rnn.py #46

KawhiZhao opened this issue May 15, 2019 · 0 comments

Comments

@KawhiZhao
Copy link

Training for 100 epochs...
Traceback (most recent call last):
File "F:/pytorch/PyTorchZeroToAll-master/13_3_char_rnn.py", line 142, in
loss = train(lines[0]) # Batch size is 1
File "F:/pytorch/PyTorchZeroToAll-master/13_3_char_rnn.py", line 117, in train
loss += criterion(output, target[c])
File "C:\Users\hh\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "C:\Users\hh\Anaconda3\lib\site-packages\torch\nn\modules\loss.py", line 862, in forward
ignore_index=self.ignore_index, reduction=self.reduction)
File "C:\Users\hh\Anaconda3\lib\site-packages\torch\nn\functional.py", line 1550, in cross_entropy
return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
File "C:\Users\hh\Anaconda3\lib\site-packages\torch\nn\functional.py", line 1403, in nll_loss
if input.size(0) != target.size(0):
RuntimeError: dimension specified as 0 but tensor has no dimensions

Process finished with exit code 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant