Connect trainer, lightning module and datamodule without calling .fit() or .test() #19010
Unanswered
nilsleh
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 0 comments
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.
-
I have a lightning module that implements a sort of calibration computation during
on_before_test_start()
where I access a dataloader through the datamodule viaself.trainer.datamodule.train_dataloader()
, do some computation and use that in thepredict_step()
.Now I would like to use the
predict_step()
directly without having to call.test()
and iterating over the entire dataloader. But if I don't do that, I get anRuntimeError: Lightningmodule is not attached to a Trainer.
Therefore, I am wondering whether there is a way to "manually" do this part to avoid calling.test()
?Beta Was this translation helpful? Give feedback.
All reactions