I would recommend following changes, which
1) 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.
2) 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:
I would recommend following changes, which 1) 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. 2) would give preference to cfg.resume_from over cfg.auto_resume [Optional]