Double backwards is not supported for CuDNN RNNs

Good morning everyone,

I am using LSTM to build the model of WGAN with gradient penalty, however, during the loss backward propagation for the critic, I have got the error ‘Double backwards is not supported for CuDNN RNNs’. So I wonder whether it is possible to solve this problem? Due to the fact that this is the model for my Master project and I don’t want to change the model, I am therefore looking forward to help!

Thank you very much for your reponse!

You could either disable cuDNN globally via torch.backends.cudnn.enabled = False, which would most likely slow down your entire code or disable it for the RNN layer only via with torch.backends.cudnn.flags(enabled=False):.

1 Like

Thank you very much! I will take a try!