Closed Ethan-Chen-plus closed 1 year ago
Hello @Ethan-Chen-plus :wave:
Thanks for reporting this! I just investigated and here is what happened:
requires_grad
set to True
requires_grad
to True
(we avoid the grad computation for each model's parameter that way, which can save a lot of memory depending on the model size)SmoothGradCAMpp
which is a bit specific. It creates a noisy input that will be forwarded into the model. And I had forgotten to set the grad computation there (until now, it couldn't crash because everything else was requiring gradient so the hook couldn't crash)As this is pretty simple to fix, I just opened a PR (#204) to address this! This should be solved on the "main" branch within a few minutes :)
Let me know if you have any questions!
Good! Thank you for solving this!
Thank you for solving this problem! However in current version(2023-02-05), this bug is not fixed in current main branch, and thus I've spent several hours debugging until coming across this issue. Therefore it is recommended that this small bug be fixed as soon as possible to help new rookies to save time. THX a lot.
Hi @zhangzw12319 :wave:
What do you mean? About the specific bug mentioned in this very issue, I merged the PR fixing it 3 weeks ago and I just tried again the exact same snippet, it works correctly :thinking: Perhaps it's because you're using the last published version of the library? Does the problem persist if you install it in developer mode first?
git clone https://github.com/frgfm/torch-cam.git
pip install -e torch-cam/.
If you're referring to another bug or another snippet, this might be unrelated and in this case, feel free to open another issue :)
Thank you for your response!
I remember that I installed it using pip install torchcam
at first glance. So it is because the last published version of the library.
Hope that the published version will be fixed soon :)
在 2023-02-06 00:50:24,"F-G Fernandez" @.***> 写道:
Hi @zhangzw12319👋
What do you mean? About the specific bug mentioned in this very issue, I merged the PR fixing it 3 weeks ago and I just tried again the exact same snippet, it works correctly 🤔 Perhaps it's because you're using the last published version of the library? Does the problem persist if you install it in developer mode first?
git clone https://github.com/frgfm/torch-cam.git
pip install -e torch-cam/.
If you're referring to another bug or another snippet, this might be unrelated and in this case, feel free to open another issue :)
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
Bug description
I clone and install torchcam,and then I use:
Code snippet to reproduce the bug
Error traceback
Environment
torch 1.11.0+cu102 torchcam 0.4.0.dev0