Why does validation epoch end before train epoch? #14318
-
|
It seems that validation_epoch_end gets called and only after that train_epoch_end gets called. Why is that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
When you run The order of all hooks are documented at: https://pytorch-lightning.readthedocs.io/en/1.7.2/common/lightning_module.html#hooks # the sanity check runs here <--- mind that here's **SANITY CHECK**
on_train_start()
for epoch in epochs:
fit_loop()
on_train_end()You can disable it by specifying |
Beta Was this translation helpful? Give feedback.
When you run
trainer.fit(...), there're two calls tovalidation_step()followed by a call tovalidation_epoch_end()before any calls totraining_step()by default.The order of all hooks are documented at: https://pytorch-lightning.readthedocs.io/en/1.7.2/common/lightning_module.html#hooks
You can disable it by specifying
Trainer(num_sanity_val_steps=0): https://pytorch-lightning.readthedocs.io/en/1.7.2/common/trainer.html#num-sanity-val-steps