Thanks! It worked!!
I was ignorant of the fact that using “model.eval()” does not turn off gradient computation! It just acts as a switch for layers like BN.
Using “torch.no_grad()” prevents computation of gradients in the validation step.