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

didn't find remove_hooks() in cam_extractor #191

Closed
boyofabear opened this issue Nov 9, 2022 · 2 comments
Closed

didn't find remove_hooks() in cam_extractor #191

boyofabear opened this issue Nov 9, 2022 · 2 comments
Assignees
Labels
module: methods Related to torchcam.methods type: breaking change

Comments

@boyofabear
Copy link

boyofabear commented Nov 9, 2022

Bug description

I downloaded the cam_example and ran it. It stopped at remove_hooks().
I checked previous issues, only to find the change of name.
I ran a jupyter demo. It worked fine with cam, but it didn't have a remove_hooks() method as well.
QQ截图20221109144911

Was the method dropped already?

Code snippet to reproduce the bug

cam_extractor.remove_hooks()

Error traceback

Traceback (most recent call last):
  File "cam_exp.py", line 135, in <module>
    main(args)
  File "cam_exp.py", line 84, in main
    extractor.remove_hooks()
AttributeError: 'CAM' object has no attribute 'remove_hooks'

Environment

torchcam 0.3.1 0 frgfm

@frgfm
Copy link
Owner

frgfm commented Nov 28, 2022

Hello @boyofabear 👋

Thanks for opening this issue!
I just checked and I cannot reproduce this locally on 0.3.2, nor on Colab (you can use the button in the documentation to open the notebook in Colab https://frgfm.github.io/torch-cam/notebooks.html)

Moreover, as you can see, the latest release does include this method: https://github.com/frgfm/torch-cam/blob/v0.3.2/torchcam/methods/core.py#L103-L107

The change was introduced in #143 and wasn't effective in v0.3.1. Thus you only need to upgrade to v0.3.2 (latest stable release) and you should be fine :)

Let me know if you encounter other problems ✌️

@frgfm frgfm added module: methods Related to torchcam.methods type: breaking change labels Nov 28, 2022
@boyofabear
Copy link
Author

thanks a lot, I updated and it works fine with demo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: methods Related to torchcam.methods type: breaking change
Projects
None yet
Development

No branches or pull requests

2 participants