Hi, I have a model which is composed of the backbone (Resnet50) + head(linear layer).
During training, I have frozen backbone so my understanding is that
model(x) = head(backbone(x)) but it is not!
Before testing, I am saving head and backbone separately and then load as-
head = torch.load('head.pt') backbone = torch.load('backbone.pt') model = torch.load('model.pt') assert model(x) == head(backbone(x))
The prediction final results are correct mostly but there is a significant change in raw logit values.
all three- model, backbone, head were set to eval before testing and
torch.no_grad was used.