Skip to content

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