Grid indices overflow bug fix (#1551)

This commit is contained in:
Glenn Jocher
2020-11-06 19:19:58 +01:00
committed by GitHub
parent ac601cf681
commit 95460570d9
+1 -1
View File
@@ -465,7 +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
indices.append((b, a, gj.clamp_(0, gain[3] - 1), gi.clamp_(0, gain[2] - 1))) # image, anchor, grid indices
tbox.append(torch.cat((gxy - gij, gwh), 1)) # box
anch.append(anchors[a]) # anchors
tcls.append(c) # class