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

load_state_dict: monkeypatch during testing #1932

Merged
merged 1 commit into from
Mar 3, 2024

Conversation

adamjstewart
Copy link
Collaborator

This was fun. Depending on the order in which these two tests are run, a second warning will be raised because the hack to fc or conv1 remained in effect. If either test was run on its own, there would be no warning. Proper solution is to monkeypatch instead of editing the original object.

@github-actions github-actions bot added the testing Continuous integration testing label Mar 3, 2024
@isaaccorley
Copy link
Collaborator

At some point I'm going to refactor this because timm has a reset_classifier method which can be used to automatically change whatever the head is. This is also a better solution because not all timm models have a conv1 and fc attribute.

@adamjstewart
Copy link
Collaborator Author

Can we merge in the meantime?

@adamjstewart adamjstewart merged commit b8f2a2b into microsoft:main Mar 3, 2024
24 checks passed
@adamjstewart adamjstewart deleted the tests/load_state_dict branch March 3, 2024 19:39
@adamjstewart adamjstewart added this to the 0.6.0 milestone Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Continuous integration testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants