Repository navigation
Question About Model Parameter Updates(self.training=false & requires_grad=true) #21329
Replies: 1 comment
|
Yes, the parameters can still update with For the second part, check whether A small CPU example on Lightning 2.6.0 reproduced that sequence. An eval-mode You can log the modes before Lightning switches to eval: def on_validation_model_eval(self):
print(self.vlm.training, self.dit.training)
super().on_validation_model_eval()If you want the whole model in training mode after validation, move that transition to: def on_validation_model_train(self):
super().on_validation_model_train()The base hook calls Prepared with Codex; the examples were checked on CPU. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What will happen when self.vlm.training is set to False and self.vlm.parameters() has requires_grad set to True? Will the model parameters be updated if there is no dropout or batch normalization in the model?
Besides, I'm opening this issue due to an unexpected change in my model. The model includes self.dit, self.vlm, and other components. After completing self.train(), self.vlm.training is set to True, but when I enter training_step(), it switches to False. I'm not sure what is causing this behavior. Any suggestions regarding the potential reasons for this issue would be greatly appreciated.
All reactions