FP16 to FP32 ckpt load

This commit is contained in:
Glenn Jocher committed 2020-06-15 13:32:45 -07:00
1 parent 6fb5ff014c
commit 76ca367a01
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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)