소스 검색

Update loss for FP16 `tobj` (#7088)

modifyDataloader
Glenn Jocher GitHub 2 년 전
부모
커밋
a2d617ece9
No known key found for this signature in database GPG Key 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…
취소
저장