diff --git a/zoobot/pytorch/training/train_with_pytorch_lightning.py b/zoobot/pytorch/training/train_with_pytorch_lightning.py index 50c5759a..daa5ae9b 100644 --- a/zoobot/pytorch/training/train_with_pytorch_lightning.py +++ b/zoobot/pytorch/training/train_with_pytorch_lightning.py @@ -114,7 +114,10 @@ def train_default_zoobot_from_scratch( assert save_dir is not None if not os.path.isdir(save_dir): - os.mkdir(save_dir) + try: + os.mkdir(save_dir) + except FileExistsError(): + pass # another gpu process may have just made it logging.info(f'Saving to {save_dir}') if color: