Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
f89fab5b
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
f89fab5b
编写于
4月 22, 2019
作者:
W
whs
提交者:
GitHub
4月 22, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix distillation in slim demo. (#2107)
上级
2d53a716
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
25 addition
and
17 deletion
+25
-17
PaddleSlim/configs/mobilenetv1_resnet50_distillation.yaml
PaddleSlim/configs/mobilenetv1_resnet50_distillation.yaml
+1
-1
PaddleSlim/configs/quantization_dist.yaml
PaddleSlim/configs/quantization_dist.yaml
+1
-1
PaddleSlim/run.sh
PaddleSlim/run.sh
+23
-15
未找到文件。
PaddleSlim/configs/mobilenetv1_resnet50_distillation.yaml
浏览文件 @
f89fab5b
...
@@ -7,7 +7,7 @@ distillers:
...
@@ -7,7 +7,7 @@ distillers:
distillation_loss_weight
:
1
distillation_loss_weight
:
1
l2_distiller
:
l2_distiller
:
class
:
'
L2Distiller'
class
:
'
L2Distiller'
teacher_feature_map
:
'
fc_1
.tmp_0'
teacher_feature_map
:
'
res_fc
.tmp_0'
student_feature_map
:
'
fc_0.tmp_0'
student_feature_map
:
'
fc_0.tmp_0'
distillation_loss_weight
:
1
distillation_loss_weight
:
1
strategies
:
strategies
:
...
...
PaddleSlim/configs/quantization_dist.yaml
浏览文件 @
f89fab5b
...
@@ -9,7 +9,7 @@ distillers:
...
@@ -9,7 +9,7 @@ distillers:
distillation_loss_weight
:
1
distillation_loss_weight
:
1
l2_distiller
:
l2_distiller
:
class
:
'
L2Distiller'
class
:
'
L2Distiller'
teacher_feature_map
:
'
fc_1
.tmp_0'
teacher_feature_map
:
'
res_fc
.tmp_0'
student_feature_map
:
'
fc_0.tmp_0'
student_feature_map
:
'
fc_0.tmp_0'
distillation_loss_weight
:
1
distillation_loss_weight
:
1
strategies
:
strategies
:
...
...
PaddleSlim/run.sh
浏览文件 @
f89fab5b
...
@@ -34,18 +34,22 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3
...
@@ -34,18 +34,22 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3
# Fixing name conflicts in distillation
# Fixing name conflicts in distillation
mv
ResNet50_pretrained/conv1_weights ResNet50_pretrained/res_conv1_weights
cd
${
pretrain_dir
}
/ResNet50_pretrained
mv
ResNet50_pretrained/fc_0.w_0 ResNet50_pretrained/res_fc.w_0
mv
conv1_weights res_conv1_weights
mv
ResNet50_pretrained/fc_0.b_0 ResNet50_pretrained/res_fc.b_0
mv
fc_0.w_0 res_fc.w_0
mv
fc_0.b_0 res_fc.b_0
cd
-
python compress.py
\
python compress.py
\
--model
"MobileNet"
\
--model
"MobileNet"
\
--teacher_model
"ResNet50"
\
--teacher_model
"ResNet50"
\
--teacher_pretrained_model
./pretrain/ResNet50_pretrained
\
--teacher_pretrained_model
./pretrain/ResNet50_pretrained
\
--compress_config
./configs/mobilenetv1_resnet50_distillation.yaml
--compress_config
./configs/mobilenetv1_resnet50_distillation.yaml
mv
ResNet50_pretrained/res_conv1_weights ResNet50_pretrained/conv1_weights
cd
${
pretrain_dir
}
/ResNet50_pretrained
mv
ResNet50_pretrained/res_fc.w_0 ResNet50_pretrained/fc_0.w_0
mv
res_conv1_weights conv1_weights
mv
ResNet50_pretrained/res_fc.b_0 ResNet50_pretrained/fc_0.b_0
mv
res_fc.w_0 fc_0.w_0
mv
res_fc.b_0 fc_0.b_0
cd
-
# for sensitivity filter pruning
# for sensitivity filter pruning
#-------------------------------
#-------------------------------
...
@@ -74,28 +78,32 @@ mv ResNet50_pretrained/res_fc.b_0 ResNet50_pretrained/fc_0.b_0
...
@@ -74,28 +78,32 @@ mv ResNet50_pretrained/res_fc.b_0 ResNet50_pretrained/fc_0.b_0
# for distillation with quantization
# for distillation with quantization
#-----------------------------------
#-----------------------------------
#export CUDA_VISIBLE_DEVICES=
0
#export CUDA_VISIBLE_DEVICES=
4,5,6,7
#
#
## Fixing name conflicts in distillation
## Fixing name conflicts in distillation
#mv ResNet50_pretrained/conv1_weights ResNet50_pretrained/res_conv1_weights
#cd ${pretrain_dir}/ResNet50_pretrained
#mv ResNet50_pretrained/fc_0.w_0 ResNet50_pretrained/res_fc.w_0
#mv conv1_weights res_conv1_weights
#mv ResNet50_pretrained/fc_0.b_0 ResNet50_pretrained/res_fc.b_0
#mv fc_0.w_0 res_fc.w_0
#mv fc_0.b_0 res_fc.b_0
#cd -
#
#
#python compress.py \
#python compress.py \
#--model "MobileNet" \
#--model "MobileNet" \
#--teacher_model "ResNet50" \
#--teacher_model "ResNet50" \
#--teacher_pretrained_model ./
data/
pretrain/ResNet50_pretrained \
#--teacher_pretrained_model ./pretrain/ResNet50_pretrained \
#--compress_config ./configs/quantization_dist.yaml
#--compress_config ./configs/quantization_dist.yaml
#
#
#mv ResNet50_pretrained/res_conv1_weights ResNet50_pretrained/conv1_weights
#cd ${pretrain_dir}/ResNet50_pretrained
#mv ResNet50_pretrained/res_fc.w_0 ResNet50_pretrained/fc_0.w_0
#mv res_conv1_weights conv1_weights
#mv ResNet50_pretrained/res_fc.b_0 ResNet50_pretrained/fc_0.b_0
#mv res_fc.w_0 fc_0.w_0
#mv res_fc.b_0 fc_0.b_0
#cd -
# for uniform filter pruning with quantization
# for uniform filter pruning with quantization
#---------------------------------------------
#---------------------------------------------
#export CUDA_VISIBLE_DEVICES=0
#export CUDA_VISIBLE_DEVICES=0
#python compress.py \
#python compress.py \
#--model "MobileNet" \
#--model "MobileNet" \
#--pretrained_model ./
data/
pretrain/MobileNetV1_pretrained \
#--pretrained_model ./pretrain/MobileNetV1_pretrained \
#--compress_config ./configs/quantization_pruning.yaml
#--compress_config ./configs/quantization_pruning.yaml
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录