Accessing DataModule or DataLoaders within model hooks #8114
Answered
by
awaelchli
MohammedAljahdali
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
-
Hey, as the title says, I want to access the DataModule or the DataLoader inside the on fit start hook. Is this possible and how can I do it? To be more specifc I want to access my model, when I have access to my DataModule, to get a batch of data, then use it to apply some pruning algorithm on my model. |
Beta Was this translation helpful? Give feedback.
Answered by
awaelchli
Jun 24, 2021
Replies: 1 comment 6 replies
-
|
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
MohammedAljahdali
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
self.datamodule
orself.trainer.train_dataloader
in the LightningModule