From c9d5694cf2a23077e678fe3e96fa355fd9b9be97 Mon Sep 17 00:00:00 2001 From: weishengyu Date: Wed, 26 May 2021 14:38:40 +0800 Subject: [PATCH] dbg --- ppcls/arch/backbone/legendary_models/hrnet.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ppcls/arch/backbone/legendary_models/hrnet.py b/ppcls/arch/backbone/legendary_models/hrnet.py index 0a3f3b1a..05ebf525 100644 --- a/ppcls/arch/backbone/legendary_models/hrnet.py +++ b/ppcls/arch/backbone/legendary_models/hrnet.py @@ -221,26 +221,22 @@ class Stage(TheseusLayer): self._num_modules = num_modules - self.stage_func_list = [] + self.stage_func_list = nn.LayerList() for i in range(num_modules): if i == num_modules - 1 and not multi_scale_output: - stage_func = self.add_sublayer( - "stage_{}_{}".format(name, i + 1), + self.stage_func_list.append( HighResolutionModule( num_filters=num_filters, has_se=has_se, multi_scale_output=False, name=name + '_' + str(i + 1))) else: - stage_func = self.add_sublayer( - "stage_{}_{}".format(name, i + 1), + self.stage_func_list.append( HighResolutionModule( num_filters=num_filters, has_se=has_se, name=name + '_' + str(i + 1))) - self.stage_func_list.append(stage_func) - def forward(self, input, res_dict=None): out = input for idx in range(self._num_modules): -- GitLab