From e8284fdc80236920df8a3e01edb83476a2c6f191 Mon Sep 17 00:00:00 2001 From: Zhiyuan Chen Date: Mon, 5 Oct 2020 20:28:16 +0800 Subject: [PATCH] Use exist_ok instead of if exists check if exists check does still arise FileExistsError when running with multi thread (slurm). Use exists_ok instead --- train_concap.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/train_concap.py b/train_concap.py index d7cc70b..a0ac3e4 100644 --- a/train_concap.py +++ b/train_concap.py @@ -272,8 +272,7 @@ def main(): default_gpu = True if default_gpu: - if not os.path.exists(savePath): - os.makedirs(savePath) + os.makedirs(savePath, exist_ok=True) config = BertConfig.from_json_file(args.config_file)