From 27849f2474fa71e174ab0d5bea1c58e869b03b00 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 6 Dec 2018 13:01:49 +0100 Subject: [PATCH] updates --- detect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/detect.py b/detect.py index 7953f30e..2f720cd8 100755 --- a/detect.py +++ b/detect.py @@ -38,12 +38,12 @@ def main(opt): if weights_path.endswith('.pt'): # pytorch format if weights_path.endswith('weights/yolov3.pt') and not os.path.isfile(weights_path): os.system('wget https://storage.googleapis.com/ultralytics/yolov3.pt -O ' + weights_path) - else: # darknet format - load_weights(model, weights_path) checkpoint = torch.load(weights_path, map_location='cpu') model.load_state_dict(checkpoint['model']) del checkpoint + else: # darknet format + load_weights(model, weights_path) # current = model.state_dict() # saved = checkpoint['model']