`--resume` training from URL weights fix (#8884)

--resume training from URL weights fix

@kalenmike should fix data error on HUB resume
pull/8883/head^2
Glenn Jocher 2022-08-05 16:42:10 +02:00 committed by GitHub
parent e073658e11
commit daed7a844e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -496,8 +496,8 @@ def main(opt, callbacks=Callbacks()):
d = torch.load(last, map_location='cpu')['opt']
opt = argparse.Namespace(**d) # replace
opt.cfg, opt.weights, opt.resume = '', str(last), True # reinstate
if is_url(opt.data):
opt.data = str(opt_data) # avoid HUB resume auth timeout
if is_url(opt_data):
opt.data = check_file(opt_data) # avoid HUB resume auth timeout
else:
opt.data, opt.cfg, opt.hyp, opt.weights, opt.project = \
check_file(opt.data), check_yaml(opt.cfg), check_yaml(opt.hyp), str(opt.weights), str(opt.project) # checks