Skip to content

Commit

Permalink
--resume training from URL weights (ultralytics#8882)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored and Clay Januhowski committed Sep 8, 2022
1 parent 3353455 commit e20eea2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,8 @@ def main(opt, callbacks=Callbacks()):
check_requirements(exclude=['thop'])

# Resume
if opt.resume and not (check_wandb_resume(opt) or opt.evolve): # resume an interrupted run
last = Path(opt.resume if isinstance(opt.resume, str) else get_latest_run()) # specified or most recent last.pt
assert last.is_file(), f'ERROR: --resume checkpoint {last} does not exist'
if opt.resume and not (check_wandb_resume(opt) or opt.evolve): # resume from specified or most recent last.pt
last = Path(check_file(opt.resume) if isinstance(opt.resume, str) else get_latest_run())
opt_yaml = last.parent.parent / 'opt.yaml' # train options yaml
opt_data = opt.data # original dataset
if opt_yaml.is_file():
Expand Down

0 comments on commit e20eea2

Please sign in to comment.