You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to debug some issues during online training (using fit_online) using pytorch hooks, but these hooks are not being executed. Looking at the code, policies are explicitly calling self.forward() like this. Directly calling self.forward() doesn't execute any hooks (see this post), so __call__() should be used instead. So self.forward() should be replaced with self().
To Reproduce
Register a hook with the policy module, e.g. algo._impl.policy.register_module_forward_pre_hook(hook)
Train with algo.fit_online(...)
Observe that the hook is never invoked
Expected behavior
The registered hooks should be executed.
Additional context
N/A.
The text was updated successfully, but these errors were encountered:
Describe the bug
I'm trying to debug some issues during online training (using
fit_online
) using pytorch hooks, but these hooks are not being executed. Looking at the code, policies are explicitly callingself.forward()
like this. Directly callingself.forward()
doesn't execute any hooks (see this post), so__call__()
should be used instead. Soself.forward()
should be replaced withself()
.To Reproduce
algo._impl.policy.register_module_forward_pre_hook(hook)
algo.fit_online(...)
Expected behavior
The registered hooks should be executed.
Additional context
N/A.
The text was updated successfully, but these errors were encountered: