From 6f1c534557e7b34aa8391db97c22ebb2414f576f Mon Sep 17 00:00:00 2001 From: chenfeiyu Date: Tue, 23 Feb 2021 10:50:57 +0800 Subject: [PATCH] use exist_ok to ensure no conflict --- parakeet/training/experiment.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/parakeet/training/experiment.py b/parakeet/training/experiment.py index 69e5ef3..bc08f4e 100644 --- a/parakeet/training/experiment.py +++ b/parakeet/training/experiment.py @@ -204,10 +204,7 @@ class ExperimentBase(object): """ # output dir output_dir = Path(self.args.output).expanduser() - if dist.get_rank() == 0: - output_dir.mkdir(parents=True, exist_ok=True) - while not output_dir.exists(): - time.sleep(1) + output_dir.mkdir(parents=True, exist_ok=True) self.output_dir = output_dir @@ -218,10 +215,7 @@ class ExperimentBase(object): """ # checkpoint dir checkpoint_dir = self.output_dir / "checkpoints" - if dist.get_rank() == 0: - checkpoint_dir.mkdir(exist_ok=True) - while not checkpoint_dir.exists(): - time.sleep(1) + checkpoint_dir.mkdir(exist_ok=True) self.checkpoint_dir = checkpoint_dir