Lightning-AI / Lightning-AI/pytorch-lightning
Allow to modify nested parameters with LightningCLI
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
### Bug description
Given the config file `my_config.yaml`
```yaml
model:
param:
sub_param: true
```
when I use lightning cli via `python train.py --config my_config.yaml --model.param.sub_param=False`
I get the error message:
`Unrecognized arguments: --model.param.sub_param=False`
### What version are you seeing the problem on?
v2.0
### How to reproduce the bug
Create a simple train file `train.py` that uses Pytorch lightning cli.
### Error messages and logs
```
# Error messages and logs here please
```
`Unrecognized arguments: --model.param.sub_param=False`
### Environment
Current environment
```
#- Lightning Component (e.g. Trainer, LightningModule, LightningApp, LightningWork, LightningFlow):
#- PyTorch Lightning Version (e.g., 1.5.0):
#- Lightning App Version (e.g., 0.5.2):
#- PyTorch Version (e.g., 2.0):
#- Python version (e.g., 3.9):
#- OS (e.g., Linux):
#- CUDA/cuDNN version:
#- GPU models and configuration:
#- How you installed Lightning(`conda`, `pip`, source):
#- Running environment of LightningApp (e.g. local, cloud):
```
### More info
_No response_
cc @borda @carmocca @mauvilsa
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the referenced train.py, my_config.yaml, and LightningCLI invocation. Start at LightningCLI's argument parsing and configuration override handling, then verify that the nested model.param.sub_param override is accepted and covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100