From 3d669f97f995d17a66c554cea6e436d4c50dab74 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Mon, 31 May 2021 10:47:10 +0800 Subject: [PATCH] fix pafnet_lite (#3196) --- configs/ttfnet/_base_/pafnet_lite_reader.yml | 1 + ppdet/modeling/heads/ttf_head.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configs/ttfnet/_base_/pafnet_lite_reader.yml b/configs/ttfnet/_base_/pafnet_lite_reader.yml index 6afbd0b09..f88e8bfff 100644 --- a/configs/ttfnet/_base_/pafnet_lite_reader.yml +++ b/configs/ttfnet/_base_/pafnet_lite_reader.yml @@ -18,6 +18,7 @@ TrainReader: shuffle: true drop_last: true use_shared_memory: true + cutmix_epoch: 200 EvalReader: sample_transforms: diff --git a/ppdet/modeling/heads/ttf_head.py b/ppdet/modeling/heads/ttf_head.py index 823b92c0b..02bb6d612 100644 --- a/ppdet/modeling/heads/ttf_head.py +++ b/ppdet/modeling/heads/ttf_head.py @@ -86,11 +86,13 @@ class HMHead(nn.Layer): head_conv.add_sublayer(name + '.act', nn.ReLU()) self.feat = head_conv bias_init = float(-np.log((1 - 0.01) / 0.01)) + weight_attr = None if lite_head else ParamAttr(initializer=Normal(0, + 0.01)) self.head = nn.Conv2D( in_channels=ch_out, out_channels=num_classes, kernel_size=1, - weight_attr=ParamAttr(initializer=Normal(0, 0.01)), + weight_attr=weight_attr, bias_attr=ParamAttr( learning_rate=2., regularizer=L2Decay(0.), @@ -160,12 +162,14 @@ class WHHead(nn.Layer): learning_rate=2., regularizer=L2Decay(0.)))) head_conv.add_sublayer(name + '.act', nn.ReLU()) + weight_attr = None if lite_head else ParamAttr(initializer=Normal(0, + 0.01)) self.feat = head_conv self.head = nn.Conv2D( in_channels=ch_out, out_channels=4, kernel_size=1, - weight_attr=ParamAttr(initializer=Normal(0, 0.001)), + weight_attr=weight_attr, bias_attr=ParamAttr( learning_rate=2., regularizer=L2Decay(0.))) -- GitLab