Model shows different predictions after training without weight update 
  
  
    Dear Community, 
i encountered some none-intuitive behaviour. I load a model, set it to evaluation mode and predict a single image using model(input). Then, I set the model to training mode and predict a single image again. (Note that there is no .backward performed, I even disabled requires_grad for all parameters). When I set the model to evaluation mode again, and predict the same image from before, I get a different result. 
TL;DR: when you eval an input before and after a training where no …
  


I faced the same problem as the above link on CIFAR10/ResNet. My model uses Batchnorm, and its update changes the result.
But I want to make my result fixed. How can I do that?

net = ResNet(ResidualBlock, 3, 16, 3, 10).to("cuda")
                net.load_state_dict(torch.load("pretrained/ckpt.pth"), strict=False)
                net.eval()
                
                with torch.no_grad():
                    input = input.to("cuda")
                    output = net(input)
                    _, predicted = output.max(1)
                    print(output)
                    print("%5s" % classes[predicted[0]])