From d1e57166109428f3462e848d18db613a681f429f Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 16 Jun 2020 16:22:58 -0700 Subject: [PATCH] train with multi-gpu half test bug fix #99 --- test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.py b/test.py index aa5cde3..df8ed67 100644 --- a/test.py +++ b/test.py @@ -46,7 +46,7 @@ def test(data, else: # called by train.py training = True device = next(model.parameters()).device # get model device - half = device.type != 'cpu' # half precision only supported on CUDA + half = device.type != 'cpu' and torch.cuda.device_count() == 1 # half precision only supported on single-GPU if half: model.half() # to FP16