L1aoXingyu / pytorch-beginner

pytorch tutorial for beginners
3k stars 1.09k forks source link

RuntimeError: cudnn RNN backward can only be called in training mode #19

Closed yuanzhoulvpi2017 closed 5 years ago

yuanzhoulvpi2017 commented 5 years ago

when I run this code called: recurrent_network.py which in pytorch-beginner-master\05-Recurrent Neural Network

a error come: Traceback (most recent call last): File "recurrent_network.py", line 83, in <module> loss.backward() File "C:\Users\yuanz\Miniconda3\envs\py36\lib\site-packages\torch\tensor.py", line 102, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "C:\Users\yuanz\Miniconda3\envs\py36\lib\site-packages\torch\autograd\__init__.py", line 90, in backward allow_unreachable=True) # allow_unreachable flag RuntimeError: cudnn RNN backward can only be called in training mode

yuanzhoulvpi2017 commented 5 years ago

This bug has been fixed。you can click this linkhttps://discuss.pytorch.org/t/cudnn-rnn-backward-can-only-be-called-in-training-mode/37622