Skip to content

Commit 288d06b

Browse files
committed
Fix: Check if checkpoint_best_regular.pth exists before trying to copy it.
1 parent a59ac19 commit 288d06b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rfdetr/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def lr_lambda(current_step: int):
473473

474474
best_is_ema = best_map_ema_5095 > best_map_5095
475475

476-
if utils.is_main_process():
476+
if utils.is_main_process() and (output_dir / 'checkpoint_best_regular.pth').exists():
477477
if best_is_ema:
478478
shutil.copy2(output_dir / 'checkpoint_best_ema.pth', output_dir / 'checkpoint_best_total.pth')
479479
else:

0 commit comments

Comments
 (0)