Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
c07758b3
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看板
提交
c07758b3
编写于
11月 22, 2022
作者:
H
HydrogenSulfate
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix engine.py
上级
fa52acd6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
9 deletion
+8
-9
ppcls/engine/engine.py
ppcls/engine/engine.py
+8
-9
未找到文件。
ppcls/engine/engine.py
浏览文件 @
c07758b3
...
@@ -144,22 +144,21 @@ class Engine(object):
...
@@ -144,22 +144,21 @@ class Engine(object):
self
.
config
[
"Global"
][
"eval_during_train"
]):
self
.
config
[
"Global"
][
"eval_during_train"
]):
if
self
.
eval_mode
in
[
"classification"
,
"adaface"
]:
if
self
.
eval_mode
in
[
"classification"
,
"adaface"
]:
self
.
eval_dataloader
=
build_dataloader
(
self
.
eval_dataloader
=
build_dataloader
(
self
.
config
[
"DataLoader"
],
"Eval"
,
self
.
device
,
self
.
config
[
"DataLoader"
],
"Eval"
,
self
.
device
,
False
)
self
.
use_dali
)
elif
self
.
eval_mode
==
"retrieval"
:
elif
self
.
eval_mode
==
"retrieval"
:
self
.
gallery_query_dataloader
=
None
self
.
gallery_query_dataloader
=
None
if
len
(
self
.
config
[
"DataLoader"
][
"Eval"
].
keys
())
==
1
:
if
len
(
self
.
config
[
"DataLoader"
][
"Eval"
].
keys
())
==
1
:
key
=
list
(
self
.
config
[
"DataLoader"
][
"Eval"
].
keys
())[
0
]
key
=
list
(
self
.
config
[
"DataLoader"
][
"Eval"
].
keys
())[
0
]
self
.
gallery_query_dataloader
=
build_dataloader
(
self
.
gallery_query_dataloader
=
build_dataloader
(
self
.
config
[
"DataLoader"
][
"Eval"
],
key
,
self
.
device
,
self
.
config
[
"DataLoader"
][
"Eval"
],
key
,
self
.
device
,
self
.
use_dali
)
False
)
else
:
else
:
self
.
gallery_dataloader
=
build_dataloader
(
self
.
gallery_dataloader
=
build_dataloader
(
self
.
config
[
"DataLoader"
][
"Eval"
],
"Gallery"
,
self
.
config
[
"DataLoader"
][
"Eval"
],
"Gallery"
,
self
.
device
,
self
.
use_dali
)
self
.
device
,
False
)
self
.
query_dataloader
=
build_dataloader
(
self
.
query_dataloader
=
build_dataloader
(
self
.
config
[
"DataLoader"
][
"Eval"
],
"Query"
,
self
.
config
[
"DataLoader"
][
"Eval"
],
"Query"
,
self
.
device
,
self
.
use_dali
)
self
.
device
,
False
)
# build loss
# build loss
if
self
.
mode
==
"train"
:
if
self
.
mode
==
"train"
:
...
@@ -339,11 +338,11 @@ class Engine(object):
...
@@ -339,11 +338,11 @@ class Engine(object):
)
)
self
.
config
[
"Global"
][
"seed"
]
=
seed
=
42
self
.
config
[
"Global"
][
"seed"
]
=
seed
=
42
logger
.
info
(
logger
.
info
(
f
"Set random seed to (
{
seed
}
+ $PADDLE_TRAINER_ID) for different trainer"
f
"Set random seed to (
{
int
(
seed
)
}
+ $PADDLE_TRAINER_ID) for different trainer"
)
)
paddle
.
seed
(
seed
+
dist
.
get_rank
())
paddle
.
seed
(
int
(
seed
)
+
dist
.
get_rank
())
np
.
random
.
seed
(
seed
+
dist
.
get_rank
())
np
.
random
.
seed
(
int
(
seed
)
+
dist
.
get_rank
())
random
.
seed
(
seed
+
dist
.
get_rank
())
random
.
seed
(
int
(
seed
)
+
dist
.
get_rank
())
# build postprocess for infer
# build postprocess for infer
if
self
.
mode
==
'infer'
:
if
self
.
mode
==
'infer'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录