Support Trainer.add_argparse_args for argparse._ArgumentGroup
Adding all of the Trainers args to an existing parser clutters its help message with many arguments. Ideally, I would like to have these in a separate argument group.
Currently:
parser = argparse.ArgumentParser()
parser.add_argument("--my_arg")
parser = pl.Trainer.add_argparse_args(parser)
parser.print_help()
usage: script.py [-h] [--my_arg MY_ARG] [--logger [LOGGER]] [--checkpoint_callback [CHECKPOINT_CALLBACK]] [--early_stop_callback [EARLY_STOP_CALLBACK]] [--default_root_dir DEFAULT_ROOT_DIR] [--gradient_clip_val GRADIENT_CLIP_VAL] (... and many more)
optional arguments:
-h, --help show this help message and exit
--my_arg MY_ARG
--logger [LOGGER] autogenerated by pl.Trainer
--checkpoint_callback [CHECKPOINT_CALLBACK]
autogenerated by pl.Trainer
--early_stop_callback [EARLY_STOP_CALLBACK]
autogenerated by pl.Trainer
--default_root_dir DEFAULT_ROOT_DIR
autogenerated by pl.Trainer
--gradient_clip_val GRADIENT_CLIP_VAL
autogenerated by pl.Trainer
(... and many more)
md5-624429db3b4fd8a179f6c448049475b4
```bash
usage: script.py [-h] [--my_arg MY_ARG] [--logger [LOGGER]] [--checkpoint_callback [CHECKPOINT_CALLBACK]] [--early_stop_callback [EARLY_STOP_CALLBACK]] [--default_root_dir DEFAULT_ROOT_DIR] [--gradient_clip_val GRADIENT_CLIP_VAL] (... and many more)
optional arguments:
-h, --help show this help message and exit
--my_arg MY_ARG
pytorch-lightning Trainer arguments:
--logger [LOGGER] autogenerated by pl.Trainer
--checkpoint_callback [CHECKPOINT_CALLBACK]
autogenerated by pl.Trainer
--early_stop_callback [EARLY_STOP_CALLBACK]
autogenerated by pl.Trainer
--default_root_dir DEFAULT_ROOT_DIR
autogenerated by pl.Trainer
--gradient_clip_val GRADIENT_CLIP_VAL
autogenerated by pl.Trainer
(... and many more)
Hi! thanks for your contribution!, great first issue!
@nateraw include this in your thing
@ananyahjha93 this will be encapsulated by it for sure.
@carmocca feature like this is coming! We are rethinking how it all should look. Thanks for the thoughtful feature request 馃槃
@nateraw update on your decision here
Closing this issue. I am using jsonargparse now, given it fits exactly my needs as demonstrated in #4492.
Also, there are several issues on this matter, closing this one so there is one less place to follow.
Most helpful comment
@ananyahjha93 this will be encapsulated by it for sure.
@carmocca feature like this is coming! We are rethinking how it all should look. Thanks for the thoughtful feature request 馃槃