未验证 提交 b98932b1 编写于 作者: F Feng Wang 提交者: GitHub

fix(vision/classification): fix pylint error due to version change (#61)

上级 ca8b7e92
...@@ -40,7 +40,7 @@ jobs: ...@@ -40,7 +40,7 @@ jobs:
- name: Pylint check - name: Pylint check
run: | run: |
export PYTHONPATH=$PWD:$PYTHONPATH export PYTHONPATH=$PWD:$PYTHONPATH
pip install pylint pip install pylint==2.5.2
pylint official/vision --rcfile=.pylintrc || pylint_ret=$? pylint official/vision --rcfile=.pylintrc || pylint_ret=$?
echo test, and deploy your project. echo test, and deploy your project.
if [ "$pylint_ret" ]; then if [ "$pylint_ret" ]; then
......
...@@ -60,7 +60,7 @@ class BasicBlock(M.Module): ...@@ -60,7 +60,7 @@ class BasicBlock(M.Module):
dilation=1, dilation=1,
norm=M.BatchNorm2d, norm=M.BatchNorm2d,
): ):
super(BasicBlock, self).__init__() super().__init__()
if groups != 1 or base_width != 64: if groups != 1 or base_width != 64:
raise ValueError("BasicBlock only supports groups=1 and base_width=64") raise ValueError("BasicBlock only supports groups=1 and base_width=64")
if dilation > 1: if dilation > 1:
...@@ -105,7 +105,7 @@ class Bottleneck(M.Module): ...@@ -105,7 +105,7 @@ class Bottleneck(M.Module):
dilation=1, dilation=1,
norm=M.BatchNorm2d, norm=M.BatchNorm2d,
): ):
super(Bottleneck, self).__init__() super().__init__()
width = int(channels * (base_width / 64.0)) * groups width = int(channels * (base_width / 64.0)) * groups
self.conv1 = M.Conv2d(in_channels, width, 1, 1, bias=False) self.conv1 = M.Conv2d(in_channels, width, 1, 1, bias=False)
self.bn1 = norm(width) self.bn1 = norm(width)
...@@ -165,7 +165,7 @@ class ResNet(M.Module): ...@@ -165,7 +165,7 @@ class ResNet(M.Module):
replace_stride_with_dilation=None, replace_stride_with_dilation=None,
norm=M.BatchNorm2d, norm=M.BatchNorm2d,
): ):
super(ResNet, self).__init__() super().__init__()
self.in_channels = 64 self.in_channels = 64
self.dilation = 1 self.dilation = 1
if replace_stride_with_dilation is None: if replace_stride_with_dilation is None:
......
...@@ -40,7 +40,7 @@ import megengine.module as M ...@@ -40,7 +40,7 @@ import megengine.module as M
class ShuffleV2Block(M.Module): class ShuffleV2Block(M.Module):
def __init__(self, inp, oup, mid_channels, *, ksize, stride): def __init__(self, inp, oup, mid_channels, *, ksize, stride):
super(ShuffleV2Block, self).__init__() super().__init__()
self.stride = stride self.stride = stride
assert stride in [1, 2] assert stride in [1, 2]
...@@ -111,7 +111,7 @@ class ShuffleV2Block(M.Module): ...@@ -111,7 +111,7 @@ class ShuffleV2Block(M.Module):
class ShuffleNetV2(M.Module): class ShuffleNetV2(M.Module):
def __init__(self, num_classes=1000, model_size="1.5x"): def __init__(self, num_classes=1000, model_size="1.5x"):
super(ShuffleNetV2, self).__init__() super().__init__()
self.stage_repeats = [4, 8, 4] self.stage_repeats = [4, 8, 4]
self.model_size = model_size self.model_size = model_size
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册