trainer.fit() hangs if first defining a nn.Module and then passing it to pl.LightningModule #11055
Unanswered
zhiqiangdon
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 1 reply
-
it should work fine. Mind sharing a reproducible example? |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
This tutorial suggests using pl.LightningModule to define a system, i.e., first defining a nn.Module model and then passing it to pl.LightningModule like this:
However, for the above case, I find trainer.fit() hangs after calling the
configure_optimizers
. Nothing is shown in the terminal and GPUs are unused.If I change the definition as follows:
The trainer.fit() works this time.
I am confused why the first definition causes trainer.fit() stuck, even the validation sanity check is not run.
Beta Was this translation helpful? Give feedback.
All reactions