From ac601cf681d8890392f28b9ec5991cd90ae0d99c Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Fri, 6 Nov 2020 13:38:13 +0100 Subject: [PATCH] Grid indices overflow bug fix (#1551) --- utils/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/utils.py b/utils/utils.py index 2643842d..506d27b8 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -465,6 +465,7 @@ def build_targets(p, targets, model): # Append indices.append((b, a, gj, gi)) # image, anchor, grid indices + indices.append((b, a, gj.clamp_(0, gain[3]), gi.clamp_(0, gain[2]))) # image, anchor, grid indices tbox.append(torch.cat((gxy - gij, gwh), 1)) # box anch.append(anchors[a]) # anchors tcls.append(c) # class