So I'm trying to load a model using:
learn = create_cnn(data, models.resnet50, lin_ftrs=[2048], metrics=accuracy)
learn.clip_grad();
learn.load(f'{name}-stage-2.1')
But I get the following error
RuntimeError: Error(s) in loading state_dict for Sequential:
size mismatch for 1.8.weight: copying a param with shape torch.Size([5004, 2048]) from checkpoint, the shape in current model is torch.Size([4542, 2048]).
size mismatch for 1.8.bias: copying a param with shape torch.Size([5004]) from checkpoint, the shape in current model is torch.Size([4542]).
The only thing that is different thing is that I added a random validation split that wasn't there in the stage-2.1
model, when I remove the split and have no validation set as the stage-2.1
was trained all goes well.
Whats happening?