-
Hi, When I try to do varaible interpolation: defaults:
- datamodule: monai_holdout
- lightningmodule: unet_like
- trainer: standard
- _self_
datamodule_type: "${datamodule}" Being my main script: import hydra
from omegaconf import DictConfig, OmegaConf
from utils import datamodule_factory, lightningmodule_factory
@hydra.main(config_path="./configs/train", config_name="config")
def main(cfg: DictConfig):
"""
Perform training.
"""
OmegaConf.register_new_resolver("get_method", hydra.utils.get_method)
cfg = hydra.utils.instantiate(cfg, _recursive_=True)
print(cfg['datamodule_type'])
main() I would like to have in Output main script: {'dataset_path': '/home/yere/Repositories/brain_tumor/datasets/dataset_concat', 'modalities': , 'ext': '.nii.gz', 'batch_size': 5, 'num_workers': 1, 'load_subset': 0.01, 'splitter': functools.partial(, ratios=[0.7, 0.15, 0.15], num_partitions=3), 'patch_func': , 'train_stage_transformations': , 'test_stage_transformations': } Is it possible to have only the name of the group by variable interpolation or by other method? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I believe this is currently not possible. Once Hydra composes the config object, the defaults lists are erased and the information about "where a given subconfig came from" is gone. |
Beta Was this translation helpful? Give feedback.
I believe this is currently not possible. Once Hydra composes the config object, the defaults lists are erased and the information about "where a given subconfig came from" is gone.
One idea I have seen before is to add
name: monai_holdout
to yourmonai_holdout.yaml
file.