SoftTeacher icon indicating copy to clipboard operation
SoftTeacher copied to clipboard

--resume-from functionality

Open lakshya-4gp opened this issue 4 years ago • 1 comments

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:
    

lakshya-4gp avatar Dec 30 '21 11:12 lakshya-4gp

Thanks for your advice. I think just changing the default value of auto_resume to False should works. I will update it.

MendelXu avatar Jan 03 '22 13:01 MendelXu