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

Hi ,

I am trying to evaluate gradient of the class score with respect to output of conv layer in my model . My model has a GRU and the entire model is in GPU. When I am running .backward() with the predicted class score, I am getting this error. My model is set to eval () mode now. Is backprop disabled for eval() mode in pytorch ?

Hi @digbose92,

Did you get some ideas?

I encounterd the same problems, and I copied similar code from another project which using cnn instead of rnn. So I am not sure this is allowed only in cnn?

Do you get the error about cudnn RNN while you are only using conv layers?
If so, could you please post the code so that we can take a look?