Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
16c01ffb
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
大约 1 年 前同步成功
通知
115
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
16c01ffb
编写于
4月 25, 2020
作者:
D
dyning
提交者:
GitHub
4月 25, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #74 from WuHaobo/googlenet
fix mixup while using GoogleNet
上级
802f283a
dab06136
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
10 deletion
+13
-10
ppcls/utils/check.py
ppcls/utils/check.py
+12
-9
ppcls/utils/config.py
ppcls/utils/config.py
+1
-1
未找到文件。
ppcls/utils/check.py
浏览文件 @
16c01ffb
...
...
@@ -16,6 +16,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
os
import
sys
import
paddle.fluid
as
fluid
...
...
@@ -36,7 +37,7 @@ def check_version():
try
:
fluid
.
require_version
(
'1.7.0'
)
except
Exception
as
e
:
except
Exception
:
logger
.
error
(
err
)
sys
.
exit
(
1
)
...
...
@@ -60,9 +61,10 @@ def check_architecture(architecture):
check architecture and recommend similar architectures
"""
assert
isinstance
(
architecture
,
dict
),
\
(
"the type of architecture({}) should be dict"
.
format
(
architecture
))
(
"the type of architecture({}) should be dict"
.
format
(
architecture
))
assert
"name"
in
architecture
,
\
(
"name must be in the architecture keys, just contains: {}"
.
format
(
architecture
.
keys
()))
(
"name must be in the architecture keys, just contains: {}"
.
format
(
architecture
.
keys
()))
similar_names
=
similar_architectures
(
architecture
[
"name"
],
get_architectures
())
...
...
@@ -83,7 +85,8 @@ def check_mix(architecture, use_mix=False):
err
=
"Cannot use mix processing in GoogLeNet, "
\
"please set use_mix = False."
try
:
if
architecture
[
"name"
]
==
"GoogLeNet"
:
assert
use_mix
==
False
if
architecture
[
"name"
]
==
"GoogLeNet"
:
assert
use_mix
is
not
True
except
AssertionError
:
logger
.
error
(
err
)
sys
.
exit
(
1
)
...
...
@@ -94,7 +97,7 @@ def check_classes_num(classes_num):
check classes_num
"""
err
=
"classes_num({}) should be a positive integer"
\
"and larger than 1"
.
format
(
classes_num
)
"and larger than 1"
.
format
(
classes_num
)
try
:
assert
isinstance
(
classes_num
,
int
)
assert
classes_num
>
1
...
...
@@ -122,12 +125,12 @@ def check_function_params(config, key):
"""
k_config
=
config
.
get
(
key
)
assert
k_config
is
not
None
,
\
(
'{} is required in config'
.
format
(
key
))
(
'{} is required in config'
.
format
(
key
))
assert
k_config
.
get
(
'function'
),
\
(
'function is required {} config'
.
format
(
key
))
(
'function is required {} config'
.
format
(
key
))
params
=
k_config
.
get
(
'params'
)
assert
params
is
not
None
,
\
(
'params is required in {} config'
.
format
(
key
))
(
'params is required in {} config'
.
format
(
key
))
assert
isinstance
(
params
,
dict
),
\
(
'the params in {} config should be a dict'
.
format
(
key
))
(
'the params in {} config should be a dict'
.
format
(
key
))
ppcls/utils/config.py
浏览文件 @
16c01ffb
...
...
@@ -100,7 +100,7 @@ def check_config(config):
architecture
=
config
.
get
(
'ARCHITECTURE'
)
check
.
check_architecture
(
architecture
)
use_mix
=
config
.
get
(
'use_mix'
)
use_mix
=
config
.
get
(
'use_mix'
,
False
)
check
.
check_mix
(
architecture
,
use_mix
)
classes_num
=
config
.
get
(
'classes_num'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录