From 76ca367a016287b14b2ba6f8a73bf91832596c24 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 15 Jun 2020 13:32:45 -0700 Subject: [PATCH] FP16 to FP32 ckpt load --- detect.py | 2 +- test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/detect.py b/detect.py index 86b6169..bf858e4 100644 --- a/detect.py +++ b/detect.py @@ -18,7 +18,7 @@ def detect(save_img=False): # Load model google_utils.attempt_download(weights) - model = torch.load(weights, map_location=device)['model'] + model = torch.load(weights, map_location=device)['model'].float() # load to FP32 # torch.save(torch.load(weights, map_location=device), weights) # update model if SourceChangeWarning # model.fuse() model.to(device).eval() diff --git a/test.py b/test.py index 292c4c4..60faf23 100644 --- a/test.py +++ b/test.py @@ -32,7 +32,7 @@ def test(data, # Load model google_utils.attempt_download(weights) - model = torch.load(weights, map_location=device)['model'] + model = torch.load(weights, map_location=device)['model'].float() # load to FP32 torch_utils.model_info(model) # model.fuse() model.to(device)