From 1c39505d4eb0d6e4c81c38849338b79bb11efe2f Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 22 Dec 2020 17:29:54 -0800 Subject: [PATCH] leaf Variable inplace bug fix (#1619) --- models/yolo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/yolo.py b/models/yolo.py index c388fb2d..191bd77c 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -148,8 +148,8 @@ class Model(nn.Module): m = self.model[-1] # Detect() module for mi, s in zip(m.m, m.stride): # from b = mi.bias.view(m.na, -1) # conv.bias(255) to (3,85) - b[:, 4] += math.log(8 / (640 / s) ** 2) # obj (8 objects per 640 image) - b[:, 5:] += math.log(0.6 / (m.nc - 0.99)) if cf is 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 mi.bias = torch.nn.Parameter(b.view(-1), requires_grad=True) def _print_biases(self):