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

Get model_name from model class on loading checkpoint #221

Merged
merged 10 commits into from
Aug 26, 2022

Conversation

pjbull
Copy link
Member

@pjbull pjbull commented Aug 25, 2022

To fix #220, we add a _default_model_name property to each model class. This allows us to look up the config specifications for a loaded checkpoint based on the model class (not just the name). We also use a utility function with lru_cache to make sure we don't have to load large checkpoint files more than once to get the hparams.

Bonus fixes:

  • Add a make format command to run black
  • Add docs fix to remove typo
  • Add save_dir to the tests so that nothing gets written to local folders
  • Add removing .DS_Store files to test cleaning

Closes #220

@pjbull pjbull requested a review from ejm714 August 25, 2022 16:18
@netlify
Copy link

netlify bot commented Aug 25, 2022

Deploy Preview for silly-keller-664934 ready!

Name Link
🔨 Latest commit 810623d
🔍 Latest deploy log https://app.netlify.com/sites/silly-keller-664934/deploys/630804932f98f90008f6408e
😎 Deploy Preview https://deploy-preview-221--silly-keller-664934.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 25, 2022

Copy link
Collaborator

@ejm714 ejm714 left a comment

Choose a reason for hiding this comment

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

Code all looks good, but can you look into the failing tests?

@codecov-commenter
Copy link

Codecov Report

Merging #221 (810623d) into master (e30c2ae) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

@@           Coverage Diff            @@
##           master    #221     +/-   ##
========================================
- Coverage    87.0%   86.8%   -0.2%     
========================================
  Files          29      29             
  Lines        1919    1903     -16     
========================================
- Hits         1670    1653     -17     
- Misses        249     250      +1     
Impacted Files Coverage Δ
zamba/models/config.py 97.1% <100.0%> (-0.2%) ⬇️
zamba/models/efficientnet_models.py 100.0% <100.0%> (ø)
zamba/models/model_manager.py 83.9% <100.0%> (-0.2%) ⬇️
zamba/models/slowfast_models.py 88.8% <100.0%> (+0.3%) ⬆️
zamba/models/utils.py 100.0% <100.0%> (ø)
zamba/version.py 80.0% <0.0%> (-20.0%) ⬇️
zamba/data/video.py 80.8% <0.0%> (-0.7%) ⬇️
zamba/models/densepose/config.py 92.2% <0.0%> (-0.2%) ⬇️

@ejm714 ejm714 self-requested a review August 25, 2022 23:40
@pjbull pjbull merged commit 17d291b into master Aug 26, 2022
@pjbull pjbull deleted the model-name-custom-model branch August 26, 2022 00:04
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.

Custom trained models can't be used without specifying video_loader_config
3 participants