from omegaconf import DictConfig, OmegaConf import hydra
@hydra.main(config_path="./conf", config_name="recoro_train") def main(cfg: DictConfig): running_dir = str(hydra.utils.get_original_cwd()) working_dir = str(Path.cwd()) print(f"The current running directory is {running_dir}") print(f"The current working directory is {working_dir}")
if __name__ == "__main__": main()
结果
1 2
The current running directory is C:\Users\xx\xx\xx\folder\ The current working directory is C:\Users\xx\xx\xx\folder\outputs\2023-02-08\22-47-06