From 0fdf9d1c09a7849b2c351f832d617cda304569b0 Mon Sep 17 00:00:00 2001 From: Benjamin Fineran Date: Mon, 29 Mar 2021 11:15:26 -0400 Subject: [PATCH] add option to disable half precision in test.py (#2507) Co-authored-by: Glenn Jocher --- test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index c0af91120e60..d099699bcad8 100644 --- a/test.py +++ b/test.py @@ -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()