Skip to content

Commit

Permalink
Merge pull request #23 from evanmlim/main
Browse files Browse the repository at this point in the history
Added check for overwriting previous runs
  • Loading branch information
aecelaya authored Jul 17, 2024
2 parents fda6a1e + a317ebc commit 41c6fef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mist/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ def main(args):
if __name__ == "__main__":
set_warning_levels()
args = get_main_args()
if not args.overwrite:
assert not os.path.exists(os.path.join(args.results, "results.csv")), \
"Results folder already contains a previous run. Enable --overwrite to overwrite the previous run"

if args.loss in ["bl", "hdl", "gsl"]:
args.use_dtm = True
Expand Down
1 change: 1 addition & 0 deletions mist/runtime/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def get_main_args():
p.arg("--master-port", type=str, default="12355", help="Master port for multi-gpu training")
p.arg("--seed_val", type=non_negative_int, default=42, help="Random seed")
p.boolean_flag("--tta", default=False, help="Enable test time augmentation")
p.boolean_flag("--overwrite", default=False, help="Overwrites previous run at specified results folder")

# Output
p.arg("--results", type=str, help="Path to output of MIST pipeline")
Expand Down

0 comments on commit 41c6fef

Please sign in to comment.