I’m also having this same error when using loss.backward() and I’ve tried debugging by disabling CuDNN.  When I have CuDNN disable the model runs, but when I have it enabled it doesn’t.  I’ve tried different ways of install pytorch with cuda, but most recently I’m using anaconda with the cudatoolkit=10.1.
Is there a way to debug if CuDNN is working properly with my installation beyond looking at the cuda version number?  The version number doesn’t seem to change despite changing my path variable.