Closed mattans closed 4 years ago
@mattans Changing num_features
from the top level instatiation isn't currently intended. Did you mean to change the number of classes for the classifer (num_classes
)?
If you want to change num_features, I'd recommend creating new a new, or editing existing _gen_XXX()
and model entrypoint function and add the necessary overrides for the num_features calculations. Note it'll currently render the pretrained weights invalid without adding addition support for ignoring the weights for the impacted convolution.
When I try:
model = torch.hub.load('rwightman/gen-efficientnet-pytorch', 'efficientnet_b0', in_chans=1, num_features=16)
or
model = torch.hub.load('rwightman/gen-efficientnet-pytorch', 'efficientnet_b0', in_chans=1, num_features=16, pretrained=False)
I get this error: