Register_forward_hook's question

Hello!

I have a question about register_forward_hook.

I make a RetinaNet’s model.

I use Resnet50’s pretrained model.

and hook layer2,layer3,layer4’s feature using register_forward_hook.

when I training this features, this features can train auto backpropagation??

If i don’t use register_backward_hook, this can be training??

thank you.

-James

I’m not sure to understand your question completely.
Generally, if you store some forward activation without detaching them from the computation graph (by calling .detach()), you will be able to use these activations in further operations and call .backward on them.
If you just want to inspect some intermediate activations, you should store them as their detached version.