Skip to content

Conversation

brianhou0208
Copy link
Contributor

Hi @rwightman ,

  1. self.reset_classifier Bug:
    The self.reset_classifier method now properly updates self.num_classes when the num_classes parameter is used. (Only a few models lacked this update, while most already had it correctly implemented)

  2. RDNet forward Method Bug:
    Fixed the forward method of RDNet, where it incorrectly called self.head(x). It now correctly calls self.forward_head(x) to ensure proper functionality during the forward pass.

@rwightman
Copy link
Collaborator

rwightman commented Jan 21, 2025

@brianhou0208 thanks, should probably add a assert model.num_classes == 0 after the model.reset_classifier(0) in test_model_default_cfgs and test_model_default_cfgs_non_std to prevent that in the future...

@brianhou0208
Copy link
Contributor Author

@rwightman finished it, added assertions to check num_classes after reset_classifier(0) in both tests

@rwightman rwightman merged commit bda46f8 into huggingface:main Jan 21, 2025
22 checks passed
@brianhou0208 brianhou0208 deleted the fix_reset_classifier branch April 23, 2025 14:42
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