Grid indices overflow bug fix (#1551)
This commit is contained in:
parent
cf652962fd
commit
ac601cf681
@ -465,6 +465,7 @@ def build_targets(p, targets, model):
|
|||||||
|
|
||||||
# Append
|
# Append
|
||||||
indices.append((b, a, gj, gi)) # image, anchor, grid indices
|
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
|
tbox.append(torch.cat((gxy - gij, gwh), 1)) # box
|
||||||
anch.append(anchors[a]) # anchors
|
anch.append(anchors[a]) # anchors
|
||||||
tcls.append(c) # class
|
tcls.append(c) # class
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user