Skip to content

Commit

Permalink
check that checkpoint folder exists before training model
Browse files Browse the repository at this point in the history
  • Loading branch information
romainphan committed Jul 4, 2024
1 parent 6628dee commit aa17397
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spyrit/core/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ def train_model(
train_info["train"] = []
train_info["val"] = []

# check that the folder `root` exists if do_checkpoint > 0
if (do_checkpoint > 0) and (not os.path.exists(root)):
raise ValueError(f"Folder {root} not found")

# Set tensorboard writer
if tb_path:
samples, _ = next(iter(dataloaders["val"]))
Expand Down

0 comments on commit aa17397

Please sign in to comment.