From e0d7d37b9e20a3147f752d11024ce948a0d645cd Mon Sep 17 00:00:00 2001 From: "552068321@qq.com" Date: Mon, 7 Nov 2022 20:49: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 44873f9..79e9292 100644 --- a/app/yolov5/train_server.py +++ b/app/yolov5/train_server.py @@ -161,8 +161,8 @@ def train(hyp, opt, device, data_list,id,callbacks): # hyp is path/to/hyp.yaml check_suffix(weights, '.pt') # check weights pretrained = weights.endswith('.pt') if pretrained: - with torch_distributed_zero_first(LOCAL_RANK): - weights = attempt_download(weights) # download if not found locally + # with torch_distributed_zero_first(LOCAL_RANK): + # weights = attempt_download(weights) # download if not found locally ckpt = torch.load(weights, map_location='cpu') # load checkpoint to CPU to avoid CUDA memory leak model = Model(cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create exclude = ['anchor'] if (cfg or hyp.get('anchors')) and not resume else [] # exclude keys