-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
So 'RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn' #473
Comments
I debug the class |
@ross-Hr Hello! This question has been bothering me for a few days, and I tried a lot of things but I couldn't solve it. This is my error output and the activations is 0. I don't know what caused it: And, below is the debug result of the official tutorial: If you have any idea what might have caused this, please let me know. |
I found that my own model was registered
|
Hi all, I will be looking into it. |
Thank you for your reply. Grad-cam caught my eye in some papers, and I wanted to implement reliable feature visualizations in my own models. So, I tried to use grad-cam for feature visualization on my own implementation of a semantic segmentation model based on Maskdino, a semantic segmentation variant of the DETR model. Here is my semantic segmentation feature visualizition script based on pytorch-grad-cam implementation:
|
Before I used grad-cam, I tried using
But when I tried to use grad-cam, I found that |
I'm using a custom model based on yolov7. Where can I manually set up |
I encounter this RuntimeError when the model inference was within the |
I used my own framework, but this error occurred.
The EigenCAM will not report the error, but all other cams that use
requires_grad=True
will report this error.I am very confused and looking forward to the next upgrade.
You can check the gradient of the model before using it, which is more user-friendly.
The problems I encountered were similar to https://github.com/jacobgil/pytorch-grad-cam/issues/323
The text was updated successfully, but these errors were encountered: