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
If one want to compile a model using hook but with a well determined behavior while traced, the trace function raise anyway. There doesn't seams to be a way to force the trace function to ignore the raise:
iforig._backward_hooksororig._forward_hooksororig._forward_pre_hooks:
raiseValueError("Modules that have hooks assigned can't be compiled")
To Reproduce
Just take a model with a dummy hook. Trace will fail.
Expected behavior
Trace should only warn, or ask a special argument (something like torch.jit.trace(model, dummy, ignore_hooks=True) )
Additional context
A quick fix would be to transform the raise into a warning. A better fix would be to ask the user to explicitly tell he want trace to ignore the presence of hooks.
Best regards,
The text was updated successfully, but these errors were encountered:
馃悰 Bug
If one want to compile a model using hook but with a well determined behavior while traced, the trace function raise anyway. There doesn't seams to be a way to force the trace function to ignore the raise:
To Reproduce
Just take a model with a dummy hook. Trace will fail.
Expected behavior
Trace should only warn, or ask a special argument (something like
torch.jit.trace(model, dummy, ignore_hooks=True)
)Additional context
A quick fix would be to transform the raise into a warning. A better fix would be to ask the user to explicitly tell he want trace to ignore the presence of hooks.
Best regards,
The text was updated successfully, but these errors were encountered: