From 2bdb9a862a12eb1e2d043236ef13c01278f6adaa Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Mon, 18 Jan 2021 20:07:56 +0800 Subject: [PATCH] fix dygraph re5_head bug, test=dygraph (#2088) --- dygraph/ppdet/modeling/backbones/resnet.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dygraph/ppdet/modeling/backbones/resnet.py b/dygraph/ppdet/modeling/backbones/resnet.py index 93f0e69ed..126669857 100755 --- a/dygraph/ppdet/modeling/backbones/resnet.py +++ b/dygraph/ppdet/modeling/backbones/resnet.py @@ -530,14 +530,15 @@ class ResNet(nn.Layer): @register class Res5Head(nn.Layer): - def __init__(self, feat_in=1024, feat_out=512): + def __init__(self, depth=50, feat_in=1024, feat_out=512): super(Res5Head, self).__init__() na = NameAdapter(self) self.res5_conv = [] self.res5 = self.add_sublayer( 'res5_roi_feat', Blocks( - feat_in, feat_out, count=3, name_adapter=na, stage_num=5)) + depth, feat_in, feat_out, count=3, name_adapter=na, + stage_num=5)) self.feat_out = feat_out * 4 def forward(self, roi_feat, stage=0): -- GitLab