Grid indices overflow bug fix (#1316)
This commit is contained in:
1 parent
58f8ba771e
commit
ea7e78cb11
1 file changed
+1
-1
+1
-1
@@ -589,7 +589,7 @@ def build_targets(p, targets, model):
|
||||
|
||||
# Append
|
||||
a = t[:, 6].long() # anchor 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
|
||||
|
||||
Reference in new issue
Block a user