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

set required_grad=True when init basecam class #443

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KKQanT
Copy link

@KKQanT KKQanT commented Jul 20, 2023

I encountered the error AxisError: axis 2 is out of bounds for array of dimension 0, which was caused by the value of grads(the input of the function get_cam_weights in every CAM class) being None. This occurred because no gradient was able to compute, due to the fact that model.required_grad was set to false during the training process by the user.

@KKQanT KKQanT changed the title add required gad when init basecam class set required_grad=True when init basecam class Jul 20, 2023
@jacobgil
Copy link
Owner

jacobgil commented Oct 6, 2023

Hi and sorry for the late reply.

Maybe it makes sense to return the requires_grad to the initial state it was, when finishing?

Because this would alter the state of the model, and could affect training.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants