How often is train_dataloader()
called for a LightningDataModule
?
#10383
Unanswered
EricWiener
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment
-
yes it will be called only once unless you set |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm seeing my model overfit and I'm trying to figure out what's going wrong. I believe that the model isn't being trained on the entire train dataset. I define my
LightningDataModule
as follows:Is it okay that I am re-initiating my dataset every time
train_dataloader
is called? I printed out whentrain_dataloader
is called and it seems to only be called once and not get reset when switching from train -> val. Could I confirm this is the actual behavior and there isn't any possibility thatMyDataset()
will end up being re-initialized/reset somehow for training data?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions