pl.Callback using a nested pl.Trainer #15968
Unanswered
gianmarcoaversanoenx
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 1 reply
-
Hi, Nested Trainers are currently not supported as there are a few global torch states we rely on in the trainer which could be mixed this way. |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
In a project, I need to evaluate some metrics during training. Thus, I use a
pl.Callback
! Very natural. However, these metrics are evaluated by quickly training another model (pl.LightninModule
), using apl.Trainer
. This creates apl.Trainer
nested in another runningpl.Trainer
via apl.Callback
.While training, all is good until
MyCallback
runs. And it runs fine. However, after it does, I get:If
MyCallback
does not use a (nested)pl.Trainer
to train the model that estimates the metrics but some custom training loop, I do not get this error. Any reason why this happens? How do I fix it?Beta Was this translation helpful? Give feedback.
All reactions