Skip to content

Commit

Permalink
add option to disable half precision in test.py (ultralytics#2507)
Browse files Browse the repository at this point in the history
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
(cherry picked from commit fd16799)
  • Loading branch information
bfineran authored and Lechtr committed Apr 1, 2021
1 parent 994a02c commit 05b8f4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()

Expand Down

0 comments on commit 05b8f4a

Please sign in to comment.