본문 바로가기
====Pytorch/Scaled Yolov4

RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.

by YGspace 2021. 7. 6.
b [:, 4] + = math.log (8 / (640 / s) ** 2) # obj (8 objects per 640 image)
b [:, 5 :] + = math.log (0.6 / (m.nc-0.99)) cf가 None이면 else torch.log (cf / cf.sum ()) # cls


↓


b.data[:, 4] += math.log(8 / (640 / s) ** 2)  # obj (8 objects per 640 image)
b.data[:, 5:] += math.log(0.6 / (m.nc - 0.99)) if cf is None else torch.log(cf / cf.sum())  # cls

yolo.py 수정

댓글