From 7d78b17a6943f02a39e060258104b9570d3c5064 Mon Sep 17 00:00:00 2001 From: YuriRibeiro <32506180+YuriRibeiro@users.noreply.github.com> Date: Wed, 29 Jul 2020 16:14:11 -0300 Subject: [PATCH] Fix utils.py nonzero() warning (#551) --- utils/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/utils.py b/utils/utils.py index 8a4aae2..e7e0ed3 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -599,7 +599,7 @@ def non_max_suppression(prediction, conf_thres=0.1, iou_thres=0.6, merge=False, # Detections matrix nx6 (xyxy, conf, cls) if multi_label: - i, j = (x[:, 5:] > conf_thres).nonzero().t() + i, j = (x[:, 5:] > conf_thres).nonzero(as_tuple=False).t() x = torch.cat((box[i], x[i, j + 5, None], j[:, None].float()), 1) else: # best class only conf, j = x[:, 5:].max(1, keepdim=True)