-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend the LightningCLI
to register models, datamodules, and callbacks.
#7250
Comments
@tchaton thank you for the proposal. I haven't thought about it yet. But I will do and comment later. |
LightningCLI
to register models, datamodules, and callbacks.
This looks very nice, Asteroid would most probably use this! |
This feature also will make specifying arguments in command line more convenient. Currently if you use subclasses for either model or data, for every argument you have to use init_args in command line, e.g. |
Being able to register models or data modules does not imply that the arguments can be overridden without using |
@register_model('image')
ModelA
@register_model('image')
ModelB
@register_datamodule('image')
DataModuleA
@register_datamodule('image')
DataModuleB
model = register.create_model()
datamodule = register.create_datamodule()
callbacks = register.create_callbacks()
trainer = register.create_trainer() |
🚀 Feature
Implement a CLI store/provider/registry for available
LightningModule
s,LightningDataModules
, andCallbacks
.Implementation
The registry idea is highly influenced by this implementation:
https://github.com/PyTorchLightning/lightning-flash/blob/master/flash/core/registry.py
https://github.com/PyTorchLightning/lightning-flash/blob/master/tests/core/test_registry.py
Usage
Console interaction
Basic help
python train.py -h
Note that the help output should look nicer, showing raw dicts for simplicity
Filter by category
python train.py -h data=CIFAR10DataModule
Basic
LightningCLI
usage (similar to what's currently implemented)The text was updated successfully, but these errors were encountered: