Open julyxia1992 opened 4 years ago
@julyxia1992 您好,请问是怎么确定_get_grads_hook没有输出的?_get_grads_hook无需显示调用,loss反向传播会自动调用
非常感谢作者的代码!本人终于可以实现自己模型的目标检测的热力图
When I load my own model ,I also met this question, my model cannot call _get_grads_hook function automatically, how do you solve this question, thanks.
When I load my own model ,I also met this question, my model cannot call _get_grads_hook function automatically, how do you solve this question, thanks.
image = torch.as_tensor(image.astype("float32").transpose(2, 0, 1)).requires_grad_(True)
this line is in demo_retinanet.py lines140 if you did not add requiresgrad(True),it cannot call _get_grads_hook function
I have made the requiresgrad as True, but i still can not get the gradient. Can you give some suggestions? @julyxia1992
我在加载自己的模型后,调用 _get_grads_hook(self, module, input_grad, output_grad): 却没有输出?