Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
97886e04
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看板
未验证
提交
97886e04
编写于
1月 19, 2021
作者:
L
littletomatodonkey
提交者:
GitHub
1月 19, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
att (#566)
* fix vgg stop grad * beautify code * refine distillation model
上级
c8c9abf0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
16 deletion
+16
-16
configs/Distillation/R50_vd_distill_MV3_large_x1_0.yaml
configs/Distillation/R50_vd_distill_MV3_large_x1_0.yaml
+1
-1
configs/Distillation/ResX101_32x16d_wsl_distill_R50_vd.yaml
configs/Distillation/ResX101_32x16d_wsl_distill_R50_vd.yaml
+1
-1
ppcls/modeling/architectures/distillation_models.py
ppcls/modeling/architectures/distillation_models.py
+14
-14
未找到文件。
configs/Distillation/R50_vd_distill_MV3_large_x1_0.yaml
浏览文件 @
97886e04
...
...
@@ -2,7 +2,7 @@ mode: 'train'
ARCHITECTURE
:
name
:
'
ResNet50_vd_distill_MobileNetV3_large_x1_0'
pretrained_model
:
"
./pretrained/ResNet50_vd_ssld_pretrained
/
"
pretrained_model
:
"
./pretrained/ResNet50_vd_ssld_pretrained"
model_save_dir
:
"
./output/"
classes_num
:
1000
total_images
:
1281167
...
...
configs/Distillation/ResX101_32x16d_wsl_distill_R50_vd.yaml
浏览文件 @
97886e04
...
...
@@ -2,7 +2,7 @@ mode: 'train'
ARCHITECTURE
:
name
:
'
ResNeXt101_32x16d_wsl_distill_ResNet50_vd'
pretrained_model
:
"
./pretrained/ResNeXt101_32x16d_wsl_pretrained
/
"
pretrained_model
:
"
./pretrained/ResNeXt101_32x16d_wsl_pretrained"
model_save_dir
:
"
./output/"
classes_num
:
1000
total_images
:
1281167
...
...
ppcls/modeling/architectures/distillation_models.py
浏览文件 @
97886e04
...
...
@@ -32,34 +32,34 @@ __all__ = [
class
ResNet50_vd_distill_MobileNetV3_large_x1_0
(
nn
.
Layer
):
def
__init__
(
self
,
class_dim
=
1000
,
**
args
):
def
__init__
(
self
,
class_dim
=
1000
,
freeze_teacher
=
True
,
**
args
):
super
(
ResNet50_vd_distill_MobileNetV3_large_x1_0
,
self
).
__init__
()
self
.
teacher
=
ResNet50_vd
(
class_dim
=
class_dim
,
**
args
)
self
.
student
=
MobileNetV3_large_x1_0
(
class_dim
=
class_dim
,
**
args
)
def
forward
(
self
,
input
):
teacher_label
=
self
.
teacher
(
input
)
teacher_label
.
stop_gradient
=
True
student_label
=
self
.
student
(
input
)
if
freeze_teacher
:
for
param
in
self
.
teacher
.
parameters
():
param
.
trainable
=
False
def
forward
(
self
,
x
):
teacher_label
=
self
.
teacher
(
x
)
student_label
=
self
.
student
(
x
)
return
teacher_label
,
student_label
class
ResNeXt101_32x16d_wsl_distill_ResNet50_vd
(
nn
.
Layer
):
def
__init__
(
self
,
class_dim
=
1000
,
**
args
):
def
__init__
(
self
,
class_dim
=
1000
,
freeze_teacher
=
True
,
**
args
):
super
(
ResNeXt101_32x16d_wsl_distill_ResNet50_vd
,
self
).
__init__
()
self
.
teacher
=
ResNeXt101_32x16d_wsl
(
class_dim
=
class_dim
,
**
args
)
self
.
student
=
ResNet50_vd
(
class_dim
=
class_dim
,
**
args
)
def
forward
(
self
,
input
):
teacher_label
=
self
.
teacher
(
input
)
teacher_label
.
stop_gradient
=
True
student_label
=
self
.
student
(
input
)
if
freeze_teacher
:
for
param
in
self
.
teacher
.
parameters
():
param
.
trainable
=
False
def
forward
(
self
,
x
):
teacher_label
=
self
.
teacher
(
x
)
student_label
=
self
.
student
(
x
)
return
teacher_label
,
student_label
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录