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

Fixed loading preprocessing params from pretrained weights #1473

Merged
merged 5 commits into from
Sep 20, 2023

Conversation

BloodAxe
Copy link
Collaborator

If pretrained weights checkpoint contains preprocessing params ensures that it is properly loaded.

Louis-Dupont
Louis-Dupont previously approved these changes Sep 20, 2023
Copy link
Contributor

@Louis-Dupont Louis-Dupont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just left 2 non-blocking comments, you can always ignore them.

About the tests, is it possible to set pretrained_weights to be a local path ? I never tried and need to dig into the code to check, but maybe it would work ?
In that case we can just quickly train a model locally and use its checkpoint path

src/super_gradients/training/utils/checkpoint_utils.py Outdated Show resolved Hide resolved
src/super_gradients/training/utils/checkpoint_utils.py Outdated Show resolved Hide resolved
@BloodAxe
Copy link
Collaborator Author

@Louis-Dupont I've added the test that saves a temporary checkpoint with preprocessing params and then ensures that predict() works as expected.
Had to patch a pretrained dict loading method though a bit :)

Copy link
Contributor

@Louis-Dupont Louis-Dupont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BloodAxe BloodAxe merged commit 96df027 into master Sep 20, 2023
7 checks passed
@BloodAxe BloodAxe deleted the bugfix/SG-1143-fix-preprocessing-params branch September 20, 2023 16:56
BloodAxe added a commit that referenced this pull request Sep 20, 2023
* Fixed loading preprocessing params from pretrained weights

* Added support for file:/// in pretrained weights

* Added test to ensure we load preprocessing params

(cherry picked from commit 96df027)
BloodAxe added a commit that referenced this pull request Sep 21, 2023
…1479)

* Fixed loading preprocessing params from pretrained weights

* Added support for file:/// in pretrained weights

* Added test to ensure we load preprocessing params

(cherry picked from commit 96df027)
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.

None yet

2 participants