Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
bb13f3c4
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看板
未验证
提交
bb13f3c4
编写于
5月 05, 2022
作者:
littletomatodonkey
提交者:
GitHub
5月 05, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix single card dist (#1889)
* fix single card logit * fix distillation yaml files
上级
c7a6fdda
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
7 addition
and
17 deletion
+7
-17
ppcls/configs/ImageNet/Distillation/mv3_large_x1_0_distill_mv3_small_x1_0.yaml
...t/Distillation/mv3_large_x1_0_distill_mv3_small_x1_0.yaml
+1
-2
ppcls/configs/ImageNet/Distillation/resnet34_distill_resnet18_afd.yaml
.../ImageNet/Distillation/resnet34_distill_resnet18_afd.yaml
+1
-3
ppcls/engine/evaluation/classification.py
ppcls/engine/evaluation/classification.py
+5
-10
ppcls/optimizer/__init__.py
ppcls/optimizer/__init__.py
+0
-2
未找到文件。
ppcls/configs/ImageNet/Distillation/mv3_large_x1_0_distill_mv3_small_x1_0.yaml
浏览文件 @
bb13f3c4
...
...
@@ -49,9 +49,8 @@ Loss:
model_name_pairs
:
-
[
"
Student"
,
"
Teacher"
]
Eval
:
-
DistillationGT
CELoss
:
-
CELoss
:
weight
:
1.0
model_names
:
[
"
Student"
]
Optimizer
:
...
...
ppcls/configs/ImageNet/Distillation/resnet34_distill_resnet18_afd.yaml
浏览文件 @
bb13f3c4
...
...
@@ -88,10 +88,8 @@ Loss:
s_shapes
:
*s_shapes
t_shapes
:
*t_shapes
Eval
:
-
DistillationGT
CELoss
:
-
CELoss
:
weight
:
1.0
model_names
:
[
"
Student"
]
Optimizer
:
name
:
Momentum
...
...
ppcls/engine/evaluation/classification.py
浏览文件 @
bb13f3c4
...
...
@@ -80,22 +80,17 @@ def classification_eval(engine, epoch_id=0):
current_samples
=
batch_size
*
paddle
.
distributed
.
get_world_size
()
accum_samples
+=
current_samples
if
isinstance
(
out
,
dict
)
and
"Student"
in
out
:
out
=
out
[
"Student"
]
if
isinstance
(
out
,
dict
)
and
"logits"
in
out
:
out
=
out
[
"logits"
]
# gather Tensor when distributed
if
paddle
.
distributed
.
get_world_size
()
>
1
:
label_list
=
[]
paddle
.
distributed
.
all_gather
(
label_list
,
batch
[
1
])
labels
=
paddle
.
concat
(
label_list
,
0
)
if
isinstance
(
out
,
dict
):
if
"Student"
in
out
:
out
=
out
[
"Student"
]
if
isinstance
(
out
,
dict
):
out
=
out
[
"logits"
]
elif
"logits"
in
out
:
out
=
out
[
"logits"
]
else
:
msg
=
"Error: Wrong key in out!"
raise
Exception
(
msg
)
if
isinstance
(
out
,
list
):
preds
=
[]
for
x
in
out
:
...
...
ppcls/optimizer/__init__.py
浏览文件 @
bb13f3c4
...
...
@@ -118,8 +118,6 @@ def build_optimizer(config, epochs, step_each_epoch, model_list=None):
if
hasattr
(
model_list
[
i
],
optim_scope
):
optim_model
.
append
(
getattr
(
model_list
[
i
],
optim_scope
))
assert
len
(
optim_model
)
==
1
,
\
"Invalid optim model for optim scope({}), number of optim_model={}"
.
format
(
optim_scope
,
len
(
optim_model
))
optim
=
getattr
(
optimizer
,
optim_name
)(
learning_rate
=
lr
,
grad_clip
=
grad_clip
,
**
optim_cfg
)(
model_list
=
optim_model
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录