add option to disable half precision in test.py (#2507)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/2344/head
Benjamin Fineran 2021-03-29 11:15:26 -04:00 committed by GitHub
parent 7cdc5165a1
commit fd1679975b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,7 @@ def test(data,
plots=True,
wandb_logger=None,
compute_loss=None,
half_precision=True,
is_coco=False):
# Initialize/load model and set device
training = model is not None
@ -61,7 +62,7 @@ def test(data,
# model = nn.DataParallel(model)
# Half
half = device.type != 'cpu' # half precision only supported on CUDA
half = device.type != 'cpu' and half_precision # half precision only supported on CUDA
if half:
model.half()