From 6fe066b36a4132ef4f7382704fb5450881a4da45 Mon Sep 17 00:00:00 2001 From: cuicheng01 <45199522+cuicheng01@users.noreply.github.com> Date: Thu, 7 Jan 2021 11:17:08 +0800 Subject: [PATCH] fix some architectures bugs (#546) * Update xception.py * Update vgg.py * Update regnet.py --- ppcls/modeling/architectures/regnet.py | 2 +- ppcls/modeling/architectures/vgg.py | 2 +- ppcls/modeling/architectures/xception.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ppcls/modeling/architectures/regnet.py b/ppcls/modeling/architectures/regnet.py index 8c2ec57e..19ddaaad 100644 --- a/ppcls/modeling/architectures/regnet.py +++ b/ppcls/modeling/architectures/regnet.py @@ -144,7 +144,7 @@ class BottleneckBlock(nn.Layer): self.se_block = SELayer( num_channels=w_b, num_filters=w_b, - reduction_channels=w_se, + reduction_ratio=w_se, name=name + "_branch2se") self.conv2 = ConvBNLayer( num_channels=w_b, diff --git a/ppcls/modeling/architectures/vgg.py b/ppcls/modeling/architectures/vgg.py index 06ba8d08..25398603 100644 --- a/ppcls/modeling/architectures/vgg.py +++ b/ppcls/modeling/architectures/vgg.py @@ -80,7 +80,7 @@ class VGGNet(nn.Layer): } assert self.layers in self.vgg_configure.keys(), \ "supported layers are {} but input layer is {}".format( - vgg_configure.keys(), layers) + self.vgg_configure.keys(), layers) self.groups = self.vgg_configure[self.layers] self._conv_block_1 = ConvBlock(3, 64, self.groups[0], name="conv1_") diff --git a/ppcls/modeling/architectures/xception.py b/ppcls/modeling/architectures/xception.py index 61c87ab4..3964fedb 100644 --- a/ppcls/modeling/architectures/xception.py +++ b/ppcls/modeling/architectures/xception.py @@ -6,6 +6,7 @@ from paddle.nn import Conv2D, BatchNorm, Linear, Dropout from paddle.nn import AdaptiveAvgPool2D, MaxPool2D, AvgPool2D from paddle.nn.initializer import Uniform import math +import sys __all__ = ['Xception41', 'Xception65', 'Xception71'] -- GitLab