diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04d62005bcd871d8b2e655f62695a59b9296e7e0..de1c51896f0bf1f9cee777cadb264773e447140d 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 7689e0e73555f57026e3b133263d4b0f09ee01d8..b9afb68a94f50541018faf0e801dc602a10b617c 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 7622a7c17ba631002797430653d1d4da531a5215..4914e5324e9ebafe7fe2641c17b17a5dd3cca08b 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