-
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
register_backward_hook #51
Comments
It probably does not register hooks in the first place. Check the next two lines where it registers the hooks on the layers.
|
I think they should be registered:
There is my function where I use GuidedBackprop.
|
I have decided this problem by unfreezing all layers in model.
|
If requires_grad is False then you can't register a backward hook (because there is no gradient). Glad you were able to solve it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good day! I use fine-tuning loaded model ResnetXt-101 from .pth file. GradCam works good with my model, but when I try to use GuidedBackprop I get the error:
-> 80 gradients_as_arr = self.gradients.data.numpy()[0]
81 return gradients_as_arr
82
AttributeError: 'NoneType' object has no attribute 'data'
The error occurs due to hook_function is not called.
Could you help me understand why it does not call?
The text was updated successfully, but these errors were encountered: