Unverified Commit 7b0727a4 authored by Anna Krogager's avatar Anna Krogager Committed by GitHub
Browse files

Ignore errors when deleting old checkpoints in trainer (#20984)

parent 15c68c67
...@@ -2776,7 +2776,7 @@ class Trainer: ...@@ -2776,7 +2776,7 @@ class Trainer:
checkpoints_to_be_deleted = checkpoints_sorted[:number_of_checkpoints_to_delete] checkpoints_to_be_deleted = checkpoints_sorted[:number_of_checkpoints_to_delete]
for checkpoint in checkpoints_to_be_deleted: for checkpoint in checkpoints_to_be_deleted:
logger.info(f"Deleting older checkpoint [{checkpoint}] due to args.save_total_limit") logger.info(f"Deleting older checkpoint [{checkpoint}] due to args.save_total_limit")
shutil.rmtree(checkpoint) shutil.rmtree(checkpoint, ignore_errors=True)
def evaluate( def evaluate(
self, self,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment