Skip to content

Commit

Permalink
fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mwalmsley committed Nov 23, 2023
1 parent e60118b commit 4d680d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zoobot/pytorch/training/train_with_pytorch_lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4d680d2

Please sign in to comment.