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

Error when clearing hooks #155

Closed
Tracked by #142
anassnouri opened this issue Apr 24, 2022 · 1 comment · Fixed by #158
Closed
Tracked by #142

Error when clearing hooks #155

anassnouri opened this issue Apr 24, 2022 · 1 comment · Fixed by #158
Assignees
Labels
bug Something isn't working topic: docs Improvements or additions to documentation
Milestone

Comments

@anassnouri
Copy link

Bug description

Dear fellow,
When I execute the following line :
`# Once you're finished, clear the hooks on your model

cam_extractor.clear_hooks()
I'm getting this error : ---------------------------------------------------------------------------

AttributeError Traceback (most recent call last)

in ()
1 # Once you're finished, clear the hooks on your model
2
----> 3 cam_extractor.clear_hooks()
4

AttributeError: 'SmoothGradCAMpp' object has no attribute 'clear_hooks'`

Do you have any idea to correct this ?
Thanks in advance

Code snippet to reproduce the bug

'''
`# Once you're finished, clear the hooks on your model

cam_extractor.clear_hooks()
'''

Error traceback

'''
`# Once you're finished, clear the hooks on your model

cam_extractor.clear_hooks()
'''

Environment

Collecting environment information...
TorchCAM version: 0.3.2.dev0+5c83d3a
PyTorch version: 1.10.0+cu111

OS: Ubuntu 18.04.5 LTS

Python version: 3.7.13
Is CUDA available: No
CUDA runtime version: 11.1.105
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.0.5

@frgfm frgfm added bug Something isn't working topic: docs Improvements or additions to documentation labels Apr 25, 2022
@frgfm frgfm added this to the 0.3.2 milestone Apr 25, 2022
@frgfm
Copy link
Owner

frgfm commented Apr 25, 2022

Hi @anassnouri 👋

Thanks for reporting this! So the method has been renamed to "remove_hooks" so that its purpose is more explicit 👍

However all the documentation and notebooks should indicate it! Did you see this instruction in the tutorial notebooks? 🙂

Cheers ✌️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic: docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants