From 79b21af761e03d62ee704c42e2841f3e906eeec7 Mon Sep 17 00:00:00 2001 From: Felix Date: Fri, 28 May 2021 18:24:18 +0800 Subject: [PATCH] Update inception_v3.py --- ppcls/arch/backbone/legendary_models/inception_v3.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ppcls/arch/backbone/legendary_models/inception_v3.py b/ppcls/arch/backbone/legendary_models/inception_v3.py index 94bfb2d6..f06c265f 100644 --- a/ppcls/arch/backbone/legendary_models/inception_v3.py +++ b/ppcls/arch/backbone/legendary_models/inception_v3.py @@ -449,10 +449,10 @@ class Inception_V3(TheseusLayer): inception_e = InceptionE(self.inception_e_list[i]) self.inception_block_list.append(inception_e) - self.gap = AdaptiveAvgPool2D(1) - self.drop = Dropout(p=0.2, mode="downscale_in_infer") + self.avg_pool = AdaptiveAvgPool2D(1) + self.dropout = Dropout(p=0.2, mode="downscale_in_infer") stdv = 1.0 / math.sqrt(2048 * 1.0) - self.out = Linear( + self.fc = Linear( 2048, class_num, weight_attr=ParamAttr( @@ -463,10 +463,10 @@ class Inception_V3(TheseusLayer): x = self.inception_stem(x) for inception_block in self.inception_block_list: x = inception_block(x) - x = self.gap(x) + x = self.avg_pool(x) x = paddle.reshape(x, shape=[-1, 2048]) - x = self.drop(x) - x = self.out(x) + x = self.dropout(x) + x = self.fc(x) return x -- GitLab