Kaynağa Gözat

Swap `unsafe_chunk()` for `chunk()` (#7362)

Eliminates all unsafe function in YOLOv5 out of an abundance of caution.
modifyDataloader
Glenn Jocher GitHub 2 yıl önce
ebeveyn
işleme
1993efd59e
Veri tabanında bu imza için bilinen anahtar bulunamadı GPC Anahtar Kimliği: 4AEE18F83AFDEB23
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. +1
    -1
      utils/loss.py

+ 1
- 1
utils/loss.py Dosyayı Görüntüle

@@ -220,7 +220,7 @@ class ComputeLoss:
offsets = 0

# Define
bc, gxy, gwh, a = t.unsafe_chunk(4, dim=1) # (image, class), grid xy, grid wh, anchors
bc, gxy, gwh, a = t.chunk(4, 1) # (image, class), grid xy, grid wh, anchors
a, (b, c) = a.long().view(-1), bc.long().T # anchors, image, class
gij = (gxy - offsets).long()
gi, gj = gij.T # grid indices

Yükleniyor…
İptal
Kaydet