Error: Cudnn RNN backward can only be called in training mode

you should read this link,I suppose it can solve your problems https://discuss.pytorch.org/t/cudnn-rnn-backward-can-only-be-called-in-training-mode/37622/2