-
Hi, When I try to override hydra logging behaviour the path for Folder structure: ./
├── hydra
│ └── job_logging
│ └── custom_default.yaml
└── train
├── config.yaml
├── datamodule
│ ├── monai_holdout.yaml
│ ├── patch_func
│ │ └── label.yaml
│ ├── splitter
│ │ └── hold_out.yaml
│ ├── test_stage_transformations
│ │ └── dummy.yaml
│ └── train_stage_transformations
│ └── dummy.yaml
├── lightningmodule
│ ├── architecture
│ │ └── unet.yaml
│ ├── loss
│ │ └── generalized_dice.yaml
│ ├── metrics
│ │ └── dice.yaml
│ ├── optimizer_configuration
│ │ └── adam.yaml
│ ├── scheduler_configuration
│ │ └── step_lr.yaml
│ └── unet_like.yaml
└── trainer
└── standard.yaml I want to override the logging behaviour from defaults:
- _self_
- datamodule: monai_holdout
- lightningmodule: unet_like
- trainer: standard
- override hydra/job_logging: custom_default
hydra:
searchpath:
- file:///home/yere/Repositories/brain_tumor/configs
datamodule_type: monai_hold_out
lightningmodule_type: unet_like 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)
datamodule_type = cfg.pop("datamodule_type")
lightningmodule_type = cfg.pop("lightningmodule_type")
datamodule = datamodule_factory(datamodule_type)(**cfg["datamodule"])
lightningmodule = lightningmodule_factory(lightningmodule_type)(
**cfg["lightningmodule"]
)
main() Then, I got the following error:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think the problem is that |
Beta Was this translation helpful? Give feedback.
I think the problem is that
config_path
is set to the directoryconfigs/train
, but thehydra/job_logging/custom_default.yaml
file is not inside of theconfigs/train
directory.