glenn-jocher commited on
Commit
ea7e78c
·
unverified ·
1 Parent(s): 58f8ba7

Grid indices overflow bug fix (#1316)

Browse files
Files changed (1) hide show
  1. utils/general.py +1 -1
utils/general.py CHANGED
@@ -589,7 +589,7 @@ def build_targets(p, targets, model):
589
 
590
  # Append
591
  a = t[:, 6].long() # anchor indices
592
- indices.append((b, a, gj.clamp_(0, gain[3]), gi.clamp_(0, gain[2]))) # image, anchor, grid indices
593
  tbox.append(torch.cat((gxy - gij, gwh), 1)) # box
594
  anch.append(anchors[a]) # anchors
595
  tcls.append(c) # class
 
589
 
590
  # Append
591
  a = t[:, 6].long() # anchor indices
592
+ indices.append((b, a, gj.clamp_(0, gain[3] - 1), gi.clamp_(0, gain[2] - 1))) # image, anchor, grid indices
593
  tbox.append(torch.cat((gxy - gij, gwh), 1)) # box
594
  anch.append(anchors[a]) # anchors
595
  tcls.append(c) # class