Traceback (most recent call last):
File “train_discriminator.py”, line 323, in 
main()
File “train_discriminator.py”, line 251, in main
loss_G.backward()
File “/anaconda3/envs/speech/lib/python3.6/site-packages/torch/tensor.py”, line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File “/anaconda3/envs/speech/lib/python3.6/site-packages/torch/autograd/init.py”, line 89, in backward
allow_unreachable=True)  # allow_unreachable flag
RuntimeError: backward_input can only be called in training mode
I was trying to train a RNN model. It fails in GPU but success in CPU.
I have checked the model by model.training. It is in training mode.
Can some one help? thanks