0

代码示例:

@hydra.main(config_path="./configs", config_name='example_01.yaml')
def main(hparams):
   # ...
   # What is the actual path of the `overrides.yaml`  file ???
   fn = ''
   tracker.log_artifact(fn)

我试过了

def main(hparams):
    # ...
    p = Path(os.getcwd())
    print(p, p.exists())
    print([fn for fn in p.glob('**/*')])

    p = Path.cwd() / '.hydra/overrides.yaml'
    print(p.exists())

输出:

./outputs/2020-07-29/19-35-52 真
[ ]

但是脚本完成后,我看到文件存在于./outputs/[date]/[time]/.hydra目录下:

config.yaml
hydra.yaml
覆盖.yaml

版本:
python:3.6.9
hydra-core:1.0.0rc1

4

1 回答 1

0

这是1.0.0rc2中的错误修复之一。

你应该升级。

您还可以通过 Hydra 配置直接访问此信息:

@hydra.main(config_name="config")
def my_app(_cfg: DictConfig) -> None:
    print(HydraConfig.get().overrides.task)
于 2020-07-30T00:06:53.490 回答