瀏覽代碼

Update loss for FP16 `tobj` (#7088)

modifyDataloader
Glenn Jocher GitHub 2 年之前
父節點
當前提交
a2d617ece9
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      utils/loss.py

+ 1
- 1
utils/loss.py 查看文件

@@ -125,7 +125,7 @@ class ComputeLoss:
# Losses
for i, pi in enumerate(p): # layer index, layer predictions
b, a, gj, gi = indices[i] # image, anchor, gridy, gridx
tobj = torch.zeros(pi.shape[:4], device=self.device) # target obj
tobj = torch.zeros(pi.shape[:4], dtype=pi.dtype, device=self.device) # target obj

n = b.shape[0] # number of targets
if n:

Loading…
取消
儲存