Model alone makes different predictions compared to trainer + model
🐛 Bug
I have trained a model and stored it in a checkpoint file. When I load the model from the checkpoint file and make predictions for my test set I get different results when I use the raw model compared to when I use the trainer class + model.
Problematic code snippets
Using the trainer class
trainer = Trainer(gpus=1)
ckpt_path='/content/gdrive/My Drive/colab_projects/colab_demo/checkpoints/model.ckpt'
model = TransferLearningModel.load_from_checkpoint(str(ckpt_path), **config)
trainer.test(model)

Not using the trainer class
model = TransferLearningModel.load_from_checkpoint(str(ckpt_path), **config)
model.freeze()
model.cuda()
with torch.no_grad():
  for x,y in dataloader:
    x = x.cuda()
    output = model(x)
    ....


To Reproduce
I have setup a colab notebook which reproduces the bug.
https://drive.google.com/file/d/16Vjcx_-NZ-pBA2mZJRSfytGTmDC8P9xY/view?usp=sharing
Happy to add more information when needed.