-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
bugSomething isn't workingSomething isn't workinglightningclipl.cli.LightningCLIpl.cli.LightningCLIver: 2.5.x
Description
Bug description
When running Lightning CLI with a config file, the position of the subcommand (fit
, validate
, etc.) affects parsing.
- ✅ Works:
uv run src/trainer.py fit -c run.yaml
- ❌ Fails:
uv run src/trainer.py -c run.yaml fit
- Error
usage: trainer.py [-h] [-c CONFIG] [--print_config[=flags]] {fit,validate,test,predict} ...
error: Validation failed: Key 'model.backbone.init_args.seq_length' is not expected
- Expected behavior
Both fit -c run.yaml and -c run.yaml fit should behave identically, or the CLI should raise a clearer error message.
What version are you seeing the problem on?
v2.5
Reproduced in studio
No response
How to reproduce the bug
Error messages and logs
# Error messages and logs here please
Environment
Current environment
#- PyTorch Lightning Version (e.g., 2.5.0):
#- PyTorch Version (e.g., 2.5):
#- Python version (e.g., 3.12):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
More info
No response
cc @mauvilsa
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinglightningclipl.cli.LightningCLIpl.cli.LightningCLIver: 2.5.x