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

Check for model initialization during eval #9

Merged
merged 9 commits into from
Oct 10, 2023
Merged

Check for model initialization during eval #9

merged 9 commits into from
Oct 10, 2023

Conversation

Phil26AT
Copy link
Collaborator

@Phil26AT Phil26AT commented Oct 9, 2023

  • Overwrite BaseModel.load_state_dict to update a state variable whether a state dict is loaded
  • BaseModel.is_initialized() checks 1) if all the modules of the current model are initialized 2) all submodels inherited from BaseModel are initialized.
  • Add model.is_initialized() assertion to eval

Fixes #7

@Phil26AT Phil26AT requested a review from sarlinpe October 9, 2023 17:26
gluefactory/eval/io.py Outdated Show resolved Hide resolved
gluefactory/models/backbones/dinov2.py Outdated Show resolved Hide resolved
gluefactory/models/base_model.py Outdated Show resolved Hide resolved
gluefactory/models/matchers/lightglue_pretrained.py Outdated Show resolved Hide resolved
@Phil26AT Phil26AT merged commit 22154a6 into main Oct 10, 2023
1 check passed
@Phil26AT Phil26AT deleted the check-init branch October 10, 2023 17:46
tompritch30 pushed a commit to tompritch30/glue-factory that referenced this pull request May 30, 2024
* Check for model initialization during eval

* Change from warning to assert

* change assertion to ValueError

* fix isort and rename are_weights_initialized

* cleanup set_initialized()

* fix variable name bug

* Make load_state_dict forward compatible

Co-authored-by: Paul-Edouard Sarlin <[email protected]>

* Remove unused imports

---------

Co-authored-by: Paul-Edouard Sarlin <[email protected]>
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.

errors when evaling on datasets
2 participants