Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
Models
提交
b98932b1
M
Models
项目概览
MegEngine 天元
/
Models
通知
6
Star
3
Fork
3
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
Models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
b98932b1
编写于
8月 28, 2020
作者:
F
Feng Wang
提交者:
GitHub
8月 28, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(vision/classification): fix pylint error due to version change (#61)
上级
ca8b7e92
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
6 deletion
+6
-6
.github/workflows/ci.yml
.github/workflows/ci.yml
+1
-1
official/vision/classification/resnet/model.py
official/vision/classification/resnet/model.py
+3
-3
official/vision/classification/shufflenet/model.py
official/vision/classification/shufflenet/model.py
+2
-2
未找到文件。
.github/workflows/ci.yml
浏览文件 @
b98932b1
...
@@ -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
...
...
official/vision/classification/resnet/model.py
浏览文件 @
b98932b1
...
@@ -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
:
...
...
official/vision/classification/shufflenet/model.py
浏览文件 @
b98932b1
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录