glenn-jocher
commited on
Commit
•
1993efd
1
Parent(s):
406ee52
Swap `unsafe_chunk()` for `chunk()` (#7362)
Browse filesEliminates all unsafe function in YOLOv5 out of an abundance of caution.
- utils/loss.py +1 -1
utils/loss.py
CHANGED
@@ -220,7 +220,7 @@ class ComputeLoss:
|
|
220 |
offsets = 0
|
221 |
|
222 |
# Define
|
223 |
-
bc, gxy, gwh, a = t.
|
224 |
a, (b, c) = a.long().view(-1), bc.long().T # anchors, image, class
|
225 |
gij = (gxy - offsets).long()
|
226 |
gi, gj = gij.T # grid indices
|
|
|
220 |
offsets = 0
|
221 |
|
222 |
# Define
|
223 |
+
bc, gxy, gwh, a = t.chunk(4, 1) # (image, class), grid xy, grid wh, anchors
|
224 |
a, (b, c) = a.long().view(-1), bc.long().T # anchors, image, class
|
225 |
gij = (gxy - offsets).long()
|
226 |
gi, gj = gij.T # grid indices
|