I would like to use the # @package _global_
directive only on a specific part of my config. E.g. here I want my datamodule to be able to override an attribute of the trainer.
Is there any way to do that?
Things I tried:
- Using
# @package _global_
at the beginning but I don't want to change the filedefault.yaml
(it's imported by other files). - Using
trainer@_global_
- Using
/trainer
- Using
_self_@_global_
(but it seems that it's not allowed and would apply all the rest of the config to_global_
).
Tree:
conf
├── config.yaml
├── datamodule
│ ├── default.yaml
│ └── my_datamodule.yaml
└── trainer
└── single_gpu.yaml
conf/datamodule/default.yaml
n_train_samples: null
conf/datamodule/my_datamodule.yaml
defaults:
- default
- _self_
batch_size: 32
# @package _global_
trainer:
val_check_interval: 99999
Expected behaviour: datamodule: n_train_samples: null batch_size: 32 trainer: val_check_interval: 99999 gpus: 1
Actual behaviour: datamodule: n_train_samples: null batch_size: 32 trainer: val_check_interval: 99999999999999999 trainer: gpus: 1