-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
3rd partyRelated to a 3rd-partyRelated to a 3rd-partyfeatureIs an improvement or enhancementIs an improvement or enhancementlightningclipl.cli.LightningCLIpl.cli.LightningCLI
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 fitError:
...
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3rd partyRelated to a 3rd-partyRelated to a 3rd-partyfeatureIs an improvement or enhancementIs an improvement or enhancementlightningclipl.cli.LightningCLIpl.cli.LightningCLI