EfficientNet-PyTorch
EfficientNet-PyTorch copied to clipboard
allow to load pretrained weights when the include_top variable is False
This merge request is related to the bug #278
The class initialization is failed when called using from_pretrained(.., include_top=False)
function or when the number of classes is not equal to 1000, i.e. from_pretrained(.., num_classes=100)
.
This pull request allow to load the pre-trained weights even when the number of classes is not equal to 1000 or when the top classifier is ignored.
_fc.weight
and _fc.bias
will only be loaded when include_top=True
and num_classes=1000
(default values)
Why hasn't this been merged yet? A simple solution to a problem affecting many users.