Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
4d482320
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
7
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindinsight
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4d482320
编写于
9月 05, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
9月 05, 2020
浏览文件
操作
浏览文件
下载
差异文件
!589 Fix ST CI
Merge pull request !589 from moran/wizard_dev
上级
c872622d
0611095a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
65 addition
and
37 deletion
+65
-37
tests/st/func/wizard/test_alexnet.py
tests/st/func/wizard/test_alexnet.py
+30
-16
tests/st/func/wizard/test_resnet50.py
tests/st/func/wizard/test_resnet50.py
+35
-21
未找到文件。
tests/st/func/wizard/test_alexnet.py
浏览文件 @
4d482320
...
@@ -129,28 +129,42 @@ class TestAlexNet:
...
@@ -129,28 +129,42 @@ class TestAlexNet:
if
source_file
.
file_relative_path
==
'src/config.py'
:
if
source_file
.
file_relative_path
==
'src/config.py'
:
content
=
source_file
.
content
content
=
source_file
.
content
if
config
[
'dataset'
]
==
'Cifar10'
:
config_dataset_is_right
=
self
.
_check_config_dataset
(
config
,
content
)
if
"'num_classes': 10"
in
content
:
config_optimizer_is_right
=
self
.
_check_config_optimizer
(
config
,
content
)
config_dataset_is_right
=
True
elif
config
[
'dataset'
]
==
'ImageNet'
:
if
"'num_classes': 1001"
in
content
:
config_dataset_is_right
=
True
if
config
[
'optimizer'
]
==
'Momentum'
:
if
"'lr': 0.002"
in
content
:
config_optimizer_is_right
=
True
elif
config
[
'optimizer'
]
==
'SGD'
:
if
"'lr': 0.01"
in
content
:
config_optimizer_is_right
=
True
else
:
if
"'lr': 0.001"
in
content
:
config_optimizer_is_right
=
True
assert
dataset_is_right
assert
dataset_is_right
assert
config_dataset_is_right
assert
config_dataset_is_right
assert
config_optimizer_is_right
assert
config_optimizer_is_right
assert
network_is_right
assert
network_is_right
assert
generator_lr_is_right
assert
generator_lr_is_right
@
staticmethod
def
_check_config_dataset
(
config
,
content
):
"""Check dataset in config"""
config_dataset_is_right
=
False
if
config
[
'dataset'
]
==
'Cifar10'
:
if
"'num_classes': 10"
in
content
:
config_dataset_is_right
=
True
elif
config
[
'dataset'
]
==
'ImageNet'
:
if
"'num_classes': 1001"
in
content
:
config_dataset_is_right
=
True
return
config_dataset_is_right
@
staticmethod
def
_check_config_optimizer
(
config
,
content
):
"""Check optimizer in config"""
config_optimizer_is_right
=
False
if
config
[
'optimizer'
]
==
'Momentum'
:
if
"'lr': 0.002"
in
content
:
config_optimizer_is_right
=
True
elif
config
[
'optimizer'
]
==
'SGD'
:
if
"'lr': 0.01"
in
content
:
config_optimizer_is_right
=
True
else
:
if
"'lr': 0.001"
in
content
:
config_optimizer_is_right
=
True
return
config_optimizer_is_right
def
check_train_eval_readme
(
self
,
dataset_name
,
loss_name
,
optimizer_name
):
def
check_train_eval_readme
(
self
,
dataset_name
,
loss_name
,
optimizer_name
):
"""Check train and eval"""
"""Check train and eval"""
...
...
tests/st/func/wizard/test_resnet50.py
浏览文件 @
4d482320
...
@@ -129,33 +129,47 @@ class TestResNet50:
...
@@ -129,33 +129,47 @@ class TestResNet50:
if
source_file
.
file_relative_path
==
'src/config.py'
:
if
source_file
.
file_relative_path
==
'src/config.py'
:
content
=
source_file
.
content
content
=
source_file
.
content
if
config
[
'dataset'
]
==
'Cifar10'
:
config_dataset_is_right
=
self
.
_check_config_dataset
(
config
,
content
)
if
"'num_classes': 10"
in
content
\
config_optimizer_is_right
=
self
.
_check_config_optimizer
(
config
,
content
)
and
"'warmup_epochs': 5"
in
content
\
and
"'lr_decay_mode': 'poly'"
in
content
:
config_dataset_is_right
=
True
elif
config
[
'dataset'
]
==
'ImageNet'
:
if
"'num_classes': 1001"
in
content
\
and
"'warmup_epochs': 0"
in
content
\
and
"'lr_decay_mode': 'cosine'"
:
config_dataset_is_right
=
True
if
config
[
'optimizer'
]
==
'Momentum'
:
if
"'lr': 0.01"
in
content
and
\
"'momentum': 0.9"
in
content
:
config_optimizer_is_right
=
True
elif
config
[
'optimizer'
]
==
'SGD'
:
if
"'lr': 0.01"
in
content
:
config_optimizer_is_right
=
True
else
:
if
"'lr': 0.001"
in
content
:
config_optimizer_is_right
=
True
assert
dataset_is_right
assert
dataset_is_right
assert
config_dataset_is_right
assert
config_dataset_is_right
assert
config_optimizer_is_right
assert
config_optimizer_is_right
assert
network_is_right
assert
network_is_right
assert
generator_lr_is_right
assert
generator_lr_is_right
@
staticmethod
def
_check_config_dataset
(
config
,
content
):
"""Check dataset in config"""
config_dataset_is_right
=
False
if
config
[
'dataset'
]
==
'Cifar10'
:
if
"'num_classes': 10"
in
content
\
and
"'warmup_epochs': 5"
in
content
\
and
"'lr_decay_mode': 'poly'"
in
content
:
config_dataset_is_right
=
True
elif
config
[
'dataset'
]
==
'ImageNet'
:
if
"'num_classes': 1001"
in
content
\
and
"'warmup_epochs': 0"
in
content
\
and
"'lr_decay_mode': 'cosine'"
:
config_dataset_is_right
=
True
return
config_dataset_is_right
@
staticmethod
def
_check_config_optimizer
(
config
,
content
):
"""Check optimizer in config"""
config_optimizer_is_right
=
False
if
config
[
'optimizer'
]
==
'Momentum'
:
if
"'lr': 0.01"
in
content
and
\
"'momentum': 0.9"
in
content
:
config_optimizer_is_right
=
True
elif
config
[
'optimizer'
]
==
'SGD'
:
if
"'lr': 0.01"
in
content
:
config_optimizer_is_right
=
True
else
:
if
"'lr': 0.001"
in
content
:
config_optimizer_is_right
=
True
return
config_optimizer_is_right
def
check_train_eval_readme
(
self
,
dataset_name
,
loss_name
,
optimizer_name
):
def
check_train_eval_readme
(
self
,
dataset_name
,
loss_name
,
optimizer_name
):
"""Check train and eval"""
"""Check train and eval"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录