'Using multiple configs in the same group to interpolate values in a yaml file

In Hydra I have the following configuration:

├── conf
    │   ├── config.yaml
    │   ├── callbacks
    │   │   ├── callback_01.yaml
    │   │   └── callback_02.yaml
    │   └── trainer
    │       ├── default.yaml
         

The callbacks have a structure like this:

_target_: callback_to_instantiate

I need to pass to the trainer/default.yaml both the callbacks through interpolation. I tried like this:

    _target_: pytorch_lightning.Trainer
    callbacks:
        - ${callbacks.callback_01}
        - ${callbacks.callback_02}

With the config.yaml like this:

    defaults:
      - _self_
      - trainer: default

I did also other trials but it doesn't seem to work. Is there a way to interpolate like that in a yaml file by using two or more yaml files that are in the config group? I would like if possible to keep this structure.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source