Browse Source

modify init

yjh0410 2 năm trước cách đây
mục cha
commit
2c43f23be8
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      models/detectors/yolov8/yolov8_pred.py

+ 3 - 0
models/detectors/yolov8/yolov8_pred.py

@@ -31,6 +31,9 @@ class SingleLevelPredLayer(nn.Module):
         b = self.reg_pred.bias.view(-1, )
         b.data.fill_(1.0)
         self.reg_pred.bias = torch.nn.Parameter(b.view(-1), requires_grad=True)
+        w = self.reg_pred.weight
+        w.data.fill_(0.)
+        self.reg_pred.weight = torch.nn.Parameter(w, requires_grad=True)
 
     def forward(self, cls_feat, reg_feat):
         """