Open
Description
Description & Motivation
This is a proposal to adjust the current error message
error: Unrecognized arguments: fit
to something more meaningful when run=False
and passing a stage is not needed. Below is a minimal example that demonstrates this:
from lightning.pytorch import LightningModule
from lightning.pytorch.cli import LightningCLI
class BoringModel(LightningModule):
pass
def main():
cli = LightningCLI(BoringModel, run=False)
cli.trainer.fit(cli.model)
if __name__ == "__main__":
main()
Run it like so:
python bug_report/bug_report_model.py fit
Error:
...
bug_report_model.py: error: Unrecognized arguments: fit
Pitch
Adjust the error for this case to a message like this, pointing out that run=False
was configured.
Error: You passed 'fit' as stage but the LightningCLI is configured with
run=False
. Selecting a stage in this case is not supported.
Alternatives
Keep as is
Additional context
Raised by a question of a user in slack channel