Are the epoch_end hooks in the LightningModule needed? #8690
Locked
Unanswered
ananthsub
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 6 replies
-
I agree with removing the duplicated hooks, the con mentioned would not affect my workflow much. |
Beta Was this translation helpful? Give feedback.
6 replies
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.
-
Lightning has had some recent issues filed around these hooks:
training_epoch_end
validation_epoch_end
test_epoch_end
predict_epoch_end
Examples:
Do we really need these on the LightningModule? Why don't users track these outputs directly inside the LightningModule?
Asking users to do this can offer some benefits:
training_epoch_end
vson_train_epoch_end
? this can improve the onboarding experience (one less class of hooks to learn about, only 1 way to do things).training_epoch_end
and don't useoutputs
, the trainer accumulates results needlessly which wastes memory. This is not clearly visible to the user either.Cons:
on_{train/val}_epoch_start
unless they want to accumulate results across epochs.@PyTorchLightning/core-contributors
Beta Was this translation helpful? Give feedback.
All reactions