@Ranahanocka
Can you explain more about why res101 should be set to training mode?
As you see, I add input1 = Variable(input1.data, requires_grad=True) in for loop.
Also I set res101.eval() because I don’t want to enable some stochastic behaviors that are encouraged during model training, e.g. dropout and batchnorm. and also we can still get gradients from the model when it is in eval mode.