RuntimeError: Error(s) in loading state_dict for DenseNet:
size mismatch for classifier.weight: copying a param with shape torch.Size([1000, 2208]) from checkpoint, the shape in current model is torch.Size([102, 2208]).
size mismatch for classifier.bias: copying a param with shape torch.Size([1000]) from checkpoint, the shape in current model is torch.Size([102]).
The classifier
layer was apparently changed before loading the state_dict
.
If you want to fine tune the model, load the state_dict
before changing the classifier
.