SoftTeacher
SoftTeacher copied to clipboard
--resume-from functionality
I would recommend following changes, which
-
Currently, even if auto_resume is not mentioned in the config, find_latest_checkpoint command will still run as cfg.get("auto_resume", True) would return True if not found.
-
would give preference to cfg.resume_from over cfg.auto_resume [Optional]
diff --git a/ssod/apis/train.py b/ssod/apis/train.py index b8bf516..1655901 100644 --- a/ssod/apis/train.py +++ b/ssod/apis/train.py @@ -194,9 +194,9 @@ def train_detector( runner = patch_runner(runner) resume_from = None - if cfg.get("auto_resume", True): + if cfg.get("auto_resume", None): resume_from = find_latest_checkpoint(cfg.work_dir) - if resume_from is not None: + if resume_from is not None and cfg.get("resume_from", False): cfg.resume_from = resume_from if cfg.resume_from:
Thanks for your advice. I think just changing the default value of auto_resume to False should works. I will update it.