Skip to content

Conversation

kurnianggoro
Copy link

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)

@spirosbax
Copy link

Why hasn't this been merged yet? A simple solution to a problem affecting many users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants