From e994b2ff2025212d34295b49161b9ed5d55b8c32 Mon Sep 17 00:00:00 2001 From: "552068321@qq.com" Date: Tue, 8 Nov 2022 09:10:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/yolov5/train_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/yolov5/train_server.py b/app/yolov5/train_server.py index 400f672..fe799d9 100644 --- a/app/yolov5/train_server.py +++ b/app/yolov5/train_server.py @@ -106,7 +106,7 @@ def train(hyp, opt, device, data_list,id,callbacks): # hyp is path/to/hyp.yaml (wd.parent if evolve else wd).mkdir(parents=True, exist_ok=True) # make dir # 获取版本号,项目名称 #version, pro_name = get_version_name(pro) - best = opt.savemodel#w + pro_name + '_' + 'R-ODY' + version + '.pt' + best = Path(opt.savemodel)#w + pro_name + '_' + 'R-ODY' + version + '.pt' #last, best = w / 'last.pt', w / 'best.pt' # Hyperparameters @@ -468,7 +468,7 @@ def train(hyp, opt, device, data_list,id,callbacks): # hyp is path/to/hyp.yaml if RANK in {-1, 0}: LOGGER.info(f'\n{epoch - start_epoch + 1} epochs completed in {(time.time() - t0) / 3600:.3f} hours.') for f in best: - if f.exists(): + if os.path.exists(f): strip_optimizer(f) # strip optimizers if f is best: LOGGER.info(f'\nValidating {f}...')