Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reset_classifier: fix it to actually work, expose toggle param for gpu #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lessw2020
Copy link

Currently the reset_classifier function does not work, as there is no self.out_dim in the model.

I've updated reset_classifier to work by using the current head in_features to determine the in channels for the new head.

I also removed global_pool param, which was dead weight and was not being used.
I added a force option in case you are not changing num_classes but still want to reset (defaults to off).
Finally, added a to_gpu flag b/c in building a model that is on cpu atm, you don't want to force only the head to gpu if the entire model will be moved later, which was how the initial version was setup.

@ghost
Copy link

ghost commented Jul 29, 2021

CLA assistant check
All CLA requirements met.

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.

1 participant