Description
Description & Motivation
I would like to configure the LightningCLI to use dataloaders in the test
subcommand, similar to this example from the docs
trainer.test(dataloaders=test_dataloaders)
As far as I can tell this impossible using the LightningCLI because you can only pass a datamodule
into it. My test set is defined differently from various training sets I have so this becomes annoying to create separate datamodules for each.
You can see that the dataloaders
option is specifically ignored in the cli.py
subcommands
method.
Pitch
I would like to specify dataloaders
in the LightningCLI
. Perhaps like:
LightningCLI(
MyModule,
train_dataloaders=MyTrainDataloader,
test_dataloaders=MyTestDataloader,
args=args
)
Alternatives
The alternative is having to create different datamodules for every combination of train/test dataloaders.
Or you have to simply just not use the CLI stuff and call lightning directly.
Additional context
I would be willing to open a PR if this feature is deemed useful.