We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When an extractor is dereferenced, its hooks are not removed by default
extractor = LayerCAM(model) del extractor # Hooks are still on the model
A call to .remove_hooks is required to fix that.
.remove_hooks
What would avoid problems is to remove them when it's deleted:
extractor = LayerCAM(model) del extractor # No more hooks of that extractor on the model
but also when it's dereferenced
extractor = LayerCAM(model) extractor = LayerCAM(model) # No more hooks of the initial extractor on the model
An option would be to use a context manager
with LayerCAM(model) as extractor: # do stuff # No more hooks on the model
The text was updated successfully, but these errors were encountered:
frgfm
Successfully merging a pull request may close this issue.
When an extractor is dereferenced, its hooks are not removed by default
A call to
.remove_hooks
is required to fix that.What would avoid problems is to remove them when it's deleted:
but also when it's dereferenced
An option would be to use a context manager
The text was updated successfully, but these errors were encountered: