From b98932b1af1d003a2bc42f363e1982115665ddc8 Mon Sep 17 00:00:00 2001 From: Feng Wang Date: Fri, 28 Aug 2020 20:59:29 +0800 Subject: [PATCH] fix(vision/classification): fix pylint error due to version change (#61) --- .github/workflows/ci.yml | 2 +- official/vision/classification/resnet/model.py | 6 +++--- official/vision/classification/shufflenet/model.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04d6200..de1c518 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: - name: Pylint check run: | export PYTHONPATH=$PWD:$PYTHONPATH - pip install pylint + pip install pylint==2.5.2 pylint official/vision --rcfile=.pylintrc || pylint_ret=$? echo test, and deploy your project. if [ "$pylint_ret" ]; then diff --git a/official/vision/classification/resnet/model.py b/official/vision/classification/resnet/model.py index 7689e0e..b9afb68 100644 --- a/official/vision/classification/resnet/model.py +++ b/official/vision/classification/resnet/model.py @@ -60,7 +60,7 @@ class BasicBlock(M.Module): dilation=1, norm=M.BatchNorm2d, ): - super(BasicBlock, self).__init__() + super().__init__() if groups != 1 or base_width != 64: raise ValueError("BasicBlock only supports groups=1 and base_width=64") if dilation > 1: @@ -105,7 +105,7 @@ class Bottleneck(M.Module): dilation=1, norm=M.BatchNorm2d, ): - super(Bottleneck, self).__init__() + super().__init__() width = int(channels * (base_width / 64.0)) * groups self.conv1 = M.Conv2d(in_channels, width, 1, 1, bias=False) self.bn1 = norm(width) @@ -165,7 +165,7 @@ class ResNet(M.Module): replace_stride_with_dilation=None, norm=M.BatchNorm2d, ): - super(ResNet, self).__init__() + super().__init__() self.in_channels = 64 self.dilation = 1 if replace_stride_with_dilation is None: diff --git a/official/vision/classification/shufflenet/model.py b/official/vision/classification/shufflenet/model.py index 7622a7c..4914e53 100644 --- a/official/vision/classification/shufflenet/model.py +++ b/official/vision/classification/shufflenet/model.py @@ -40,7 +40,7 @@ import megengine.module as M class ShuffleV2Block(M.Module): def __init__(self, inp, oup, mid_channels, *, ksize, stride): - super(ShuffleV2Block, self).__init__() + super().__init__() self.stride = stride assert stride in [1, 2] @@ -111,7 +111,7 @@ class ShuffleV2Block(M.Module): class ShuffleNetV2(M.Module): def __init__(self, num_classes=1000, model_size="1.5x"): - super(ShuffleNetV2, self).__init__() + super().__init__() self.stage_repeats = [4, 8, 4] self.model_size = model_size -- GitLab