未验证 提交 a5d46d3d 编写于 作者: W Wenyu 提交者: GitHub

update bias init (#4213)

上级 b9a90cda
...@@ -307,9 +307,11 @@ class DeformableDETRHead(nn.Layer): ...@@ -307,9 +307,11 @@ class DeformableDETRHead(nn.Layer):
linear_init_(self.score_head) linear_init_(self.score_head)
constant_(self.score_head.bias, -4.595) constant_(self.score_head.bias, -4.595)
constant_(self.bbox_head.layers[-1].weight) constant_(self.bbox_head.layers[-1].weight)
bias = paddle.zeros_like(self.bbox_head.layers[-1].bias)
bias[2:] = -2.0 with paddle.no_grad():
self.bbox_head.layers[-1].bias.set_value(bias) bias = paddle.zeros_like(self.bbox_head.layers[-1].bias)
bias[2:] = -2.0
self.bbox_head.layers[-1].bias.set_value(bias)
@classmethod @classmethod
def from_config(cls, cfg, hidden_dim, nhead, input_shape): def from_config(cls, cfg, hidden_dim, nhead, input_shape):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册