1

I am currently using the hydra config file as a part of a deep learning framework, in order to declare several parameters. I wrote a help section in my config.yaml file to declare all the parameters and describe them:

help:
    header: == HYDRA CONFIG FILE ARGUMENTS DESCRIPTION ==


    template: |-
      ${hydra.help.header}
      The hydra config file is used to fill in the arguments for the segmentation monai framework.
      It is split in several parts with arguments that will be used for the training:

      - data
        - root_path:            TYPE=STR
                                root directory containing the data and gt folder that contains files in nifti format.
                                Directory must also contains the db.csv dataframe that list the patients IDs and TAGS
        ...

     - split
        - run:                  TYPE=BOOL
                                Whether to run the split part or not.
        - eval_ratio:           TYPE=FLOAT
                                Split ratio for the eval.
        - test_ratio:           TYPE=FLOAT
                                Split ratio for the test.
        ...

     - train:
        - run:                  TYPE=BOOL
                                Whether to run the train part or not.
        - seed:                 TYPE=INT
                                Define a seed if you want to run deterministic training for reproductibility
        ...

I know that the command to display the help is the following one: python d:/projects/my_file.py --help

The problem is that this command displays the full help section. My question is: is there a way to display only a subsection of this help message, only the "data" part for example ?

Thank you for your help.

ofares
  • 33
  • 4
  • Cross-link to related github discussions page: https://github.com/facebookresearch/hydra/discussions/2540 – Jasha Jan 11 '23 at 10:50

2 Answers2

0

Currently (2022-01-11) there is no smooth way to access just a sub-part of the help via the CLI. There is an open feature https://github.com/facebookresearch/hydra/issues/633 that's related to this topic.

Jasha
  • 5,507
  • 2
  • 33
  • 44
0

As @Jasha mentioned, Hydra's help support is lacking. Hydra definitely does not understand the help format you invented in order to print only a sub section of it.

One thing that can be of some use is to print a subsection of the config itself. This will not include any of your fancy additional help though, but it will show you any sub section of the config (including the help).

$python main.py --cfg job -p foo.bar

Where foo.bar is the sub-section you want to output.

Omry Yadan
  • 31,280
  • 18
  • 64
  • 87