How the model.train() and model.eval() switch work in Pytorch Lightning? #20271
Unanswered
lndip
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment
-
@lndip Did you get any solution? I am in a similar kind of scenario. I am trying to implement a loss with learnable weight. Here, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am implementing a knowledge distillation (KD) framework. The teacher model architecture has the BatchNorm and Dropout which must be in evaluation mode during the training of the student in the KD process. Is freezing the teacher in the initialization of the LightningModule as followed is enough? Or do I have to explicitly do that use the hook
on_train_start()
Beta Was this translation helpful? Give feedback.
All reactions