Understanding LightningModule hooks #15177
Unanswered
gianmarcoaversanoenx
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 6 replies
-
I'm not sure if I understand your question correctly. I had a look at your notebook, but the one training with automatic optimization failed due to the following error: automatic optimization debug logs and an error
|
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Reading from the official doc, it looks like the fit loop should be:
But I am failing to see how this is true. You can check this notebook.
There, I create two models. One with manual optimization:
And one with automatic:
Both models have one
print
in every hook, so that I can check the order they are executed and they aren't the same... Is there any in-depth documentation that explains what's going on?For the manual model:
For the automatic one:
Very weirdly, notice that
on_before_optimizer_step
is never called andoptimizer_step
is called beforetraining_step
, but the official doc says otherwise...Beta Was this translation helpful? Give feedback.
All reactions