run=False in CLI prevents some config keys from being accepted
See original GitHub issue🐛 Bug
Instantiating LightningCLI with run=False prevents some config keys (namely seed_everything andckpt_path) from being accepted. This seems to be because these config keys are defined by a subcommand parser, and these are not initialized when run=False is passed.
This makes it impossible to load config files created by Lightning during training since they contain the seed_everythingckpt_path key.
To Reproduce
error: 'Configuration check failed :: No action for destination key "ckpt_path" to check its value.'
Expected behavior
Should run without error.
Environment
- CUDA:
- GPU:
- Tesla K80
- available: True
- version: 11.1
- GPU:
- Packages:
- numpy: 1.21.5
- pyTorch_debug: False
- pyTorch_version: 1.10.0+cu111
- pytorch-lightning: 1.5.10
- tqdm: 4.63.0
- System:
- OS: Linux
- architecture:
- 64bit
- processor: x86_64
- python: 3.7.12
- version: # 1 SMP Tue Dec 7 09:58:10 PST 2021
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
run=False in CLI prevents some config keys from being ...
Bug Instantiating LightningCLI with run=False prevents some config keys (namely seed_everything and ckpt_path) from being accepted.
Read more >Lightning CLI and config files
Lightning CLI and config files. Another source of boilerplate code that Lightning can help to reduce is in the implementation of command line...
Read more >Configuration basics - AWS Command Line Interface
This section explains how to quickly configure basic settings using the config and credentials files that the AWS Command Line Interface (AWS CLI)...
Read more >Command Line Reference | SSN Docs
It is used once a series of configuration changes have been made, and an administrator wishes to "activate" those configuration changes. When run...
Read more >Specifying that keys are used only once
You can use the command-line interface or REST interface to set the ... Turning on this flag can cause key serving to stop...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

LightningCLIis a class intended to ease the implementation of command line tools. Any change in the python source code in general is a new CLI. For more context also read lightning_cli.html#notes-related-to-reproducibility.With
run=Falseonly the classes are instantiated. It is up to the developer to implement which and how theTrainermethods are called. And to add to the argument parser any additional needed parameters.I would say loading a model from a configuration file in jupyter notebook is a quite common scenario for many research projects. For example, we may want to create colab demo for our research projects or run some interactive visualization or experiment on downstream tasks with our model. A simple workaround for current version could be something like this:
You just need to instantiate this CLI instead of the CLI you are currently using. But still I think it would be good if those scenarios can be addressed by the LightningCLI or have some documentations or examples to make the LightningCLI much easier to use for researchers. I would like to help if you think instantiating the model with CLI follows the philosophy of this library.