add option to disable half precision in test.py (#2507)
Browse filesCo-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
test.py
CHANGED
@@ -37,6 +37,7 @@ def test(data,
|
|
37 |
plots=True,
|
38 |
wandb_logger=None,
|
39 |
compute_loss=None,
|
|
|
40 |
is_coco=False):
|
41 |
# Initialize/load model and set device
|
42 |
training = model is not None
|
@@ -61,7 +62,7 @@ def test(data,
|
|
61 |
# model = nn.DataParallel(model)
|
62 |
|
63 |
# Half
|
64 |
-
half = device.type != 'cpu' # half precision only supported on CUDA
|
65 |
if half:
|
66 |
model.half()
|
67 |
|
|
|
37 |
plots=True,
|
38 |
wandb_logger=None,
|
39 |
compute_loss=None,
|
40 |
+
half_precision=True,
|
41 |
is_coco=False):
|
42 |
# Initialize/load model and set device
|
43 |
training = model is not None
|
|
|
62 |
# model = nn.DataParallel(model)
|
63 |
|
64 |
# Half
|
65 |
+
half = device.type != 'cpu' and half_precision # half precision only supported on CUDA
|
66 |
if half:
|
67 |
model.half()
|
68 |
|