I'm working through this Hydra doc example to override the main config with an experiment config. I'm trying to override main
with experiment
and I'm not sure where I'm going wrong.
The error I get is:
Exception has occurred: ConstructorError
while constructing a mapping
in "/home/ghb/projects/aisc/embeddings_and_difficulty/configs_hydra/experiment/experiment.yaml", line 2, column 1
found duplicate key main
in "/home/ghb/projects/aisc/embeddings_and_difficulty/configs_hydra/experiment/experiment.yaml", line 9, column 1
File "/home/ghb/projects/aisc/embeddings_and_difficulty/runner.py", line 70, in <module>
main()
yaml.constructor.ConstructorError: while constructing a mapping
in "/home/ghb/projects/aisc/embeddings_and_difficulty/configs_hydra/experiment/experiment.yaml", line 2, column 1
found duplicate key main
in "/home/ghb/projects/aisc/embeddings_and_difficulty/configs_hydra/experiment/experiment.yaml", line 9, column 1
Folder structure:
configs
|--- experiment
|--- experiment.yaml
|--- main
|--- general.yaml
|--- debug.yaml
config.yaml
My config.yaml
:
defaults:
- main: general
- experiment: experiment
My experiment.yaml
:
# @package _global_
defaults:
- override /main: debug
main:
TRAINING:
BACKBONE:
MAX_EPOCH: 20
My general.yaml
:
main:
TRAINING:
BACKBONE:
MAX_EPOCH: 200
My debug.yaml
:
main:
TRAINING:
BACKBONE:
MAX_EPOCH: 2