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 ?
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?