Unverified Commit 8e9e1c89 authored by ZhouGengmo's avatar ZhouGengmo Committed by GitHub
Browse files

allow --keep-last-epochs == 0 (#26)



allow --keep-last-checkpoints == 0
Co-authored-by: default avatarzhougm <zhougm@dp.com>
parent c1f8c0e2
......@@ -46,7 +46,7 @@ def ckp_copy_fun(src, checkpoints, end_of_epoch, args):
os.remove(old_chk)
logger.info("removed {}".format(old_chk))
if args.keep_last_epochs > 0:
if args.keep_last_epochs >= 0:
# remove old epoch checkpoints; checkpoints are sorted in descending order
checkpoints = checkpoint_paths(root_path, pattern=r"checkpoint(\d+)\.pt")
for old_chk in checkpoints[args.keep_last_epochs :]:
......
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