Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
353e7529
P
PaddleSeg
项目概览
PaddlePaddle
/
PaddleSeg
通知
285
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
353e7529
编写于
2月 11, 2020
作者:
L
LielinJiang
提交者:
GitHub
2月 11, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #161 from LielinJiang/fix_bug_0211
fix nas python3 bug and update distill pretrained model
上级
ebc9bb93
031d89ee
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
6 deletion
+11
-6
slim/distillation/README.md
slim/distillation/README.md
+7
-2
slim/distillation/cityscape.yaml
slim/distillation/cityscape.yaml
+1
-1
slim/distillation/cityscape_teacher.yaml
slim/distillation/cityscape_teacher.yaml
+1
-1
slim/nas/README.md
slim/nas/README.md
+1
-1
slim/nas/mobilenetv2_search_space.py
slim/nas/mobilenetv2_search_space.py
+1
-1
未找到文件。
slim/distillation/README.md
浏览文件 @
353e7529
...
@@ -69,7 +69,10 @@ distill_loss = l2_loss('teacher_bilinear_interp_2.tmp_0', 'bilinear_interp_0.tmp
...
@@ -69,7 +69,10 @@ distill_loss = l2_loss('teacher_bilinear_interp_2.tmp_0', 'bilinear_interp_0.tmp
在该脚本中定义了teacher_model和student_model,用teacher_model的输出指导student_model的训练
在该脚本中定义了teacher_model和student_model,用teacher_model的输出指导student_model的训练
### 执行示例
### 执行示例
如下命令启动训练,每间隔
```cfg.TRAIN.SNAPSHOT_EPOCH```
会进行一次评估。
下载teacher的预训练模型和student的预训练模型, 替换如下命令中的
```your_tearcher_pretrained_model_path```
和
```your_student_pretrained_model```
执行如下命令启动训练,每间隔
```cfg.TRAIN.SNAPSHOT_EPOCH```
会进行一次评估。
```
shell
```
shell
CUDA_VISIBLE_DEVICES
=
0,1
CUDA_VISIBLE_DEVICES
=
0,1
python
-m
paddle.distributed.launch ./slim/distillation/train_distill.py
\
python
-m
paddle.distributed.launch ./slim/distillation/train_distill.py
\
...
@@ -77,7 +80,9 @@ python -m paddle.distributed.launch ./slim/distillation/train_distill.py \
...
@@ -77,7 +80,9 @@ python -m paddle.distributed.launch ./slim/distillation/train_distill.py \
--teacher_cfg
./slim/distillation/cityscape_teacher.yaml
\
--teacher_cfg
./slim/distillation/cityscape_teacher.yaml
\
--use_gpu
\
--use_gpu
\
--use_mpio
\
--use_mpio
\
--do_eval
--do_eval
\
SLIM.KNOWLEDGE_DISTILL_TEACHER_MODEL_DIR your_tearcher_pretrained_model_path
\
TRAIN.PRETRAINED_MODEL_DIR your_student_pretrained_model
```
```
## 评估预测
## 评估预测
...
...
slim/distillation/cityscape.yaml
浏览文件 @
353e7529
...
@@ -49,7 +49,7 @@ TEST:
...
@@ -49,7 +49,7 @@ TEST:
TEST_MODEL
:
"
snapshots/cityscape_v5/final/"
TEST_MODEL
:
"
snapshots/cityscape_v5/final/"
TRAIN
:
TRAIN
:
MODEL_SAVE_DIR
:
"
snapshots/cityscape_mbv2_kd_e100_1/"
MODEL_SAVE_DIR
:
"
snapshots/cityscape_mbv2_kd_e100_1/"
PRETRAINED_MODEL_DIR
:
u"
/workspace/pretrained_models
/mobilenet_cityscapes"
PRETRAINED_MODEL_DIR
:
u"
pretrained_model
/mobilenet_cityscapes"
SNAPSHOT_EPOCH
:
5
SNAPSHOT_EPOCH
:
5
SYNC_BATCH_NORM
:
True
SYNC_BATCH_NORM
:
True
SOLVER
:
SOLVER
:
...
...
slim/distillation/cityscape_teacher.yaml
浏览文件 @
353e7529
...
@@ -61,5 +61,5 @@ SOLVER:
...
@@ -61,5 +61,5 @@ SOLVER:
SLIM
:
SLIM
:
KNOWLEDGE_DISTILL_IS_TEACHER
:
True
KNOWLEDGE_DISTILL_IS_TEACHER
:
True
KNOWLEDGE_DISTILL
:
True
KNOWLEDGE_DISTILL
:
True
KNOWLEDGE_DISTILL_TEACHER_MODEL_DIR
:
"
/workspace/pretrained_models
/xception65_bn_cityscapes"
KNOWLEDGE_DISTILL_TEACHER_MODEL_DIR
:
"
pretrained_model
/xception65_bn_cityscapes"
slim/nas/README.md
浏览文件 @
353e7529
...
@@ -46,7 +46,7 @@ SLIM:
...
@@ -46,7 +46,7 @@ SLIM:
## 训练与评估
## 训练与评估
执行以下命令,边训练边评估
执行以下命令,边训练边评估
```
shell
```
shell
python
-u
./slim/nas/train_nas.py
--log_steps
10
--cfg
configs/deeplabv3p_mobilenetv2_cityscapes.yaml
--use_gpu
--use_mpio
\
CUDA_VISIBLE_DEVICES
=
0
python
-u
./slim/nas/train_nas.py
--log_steps
10
--cfg
configs/deeplabv3p_mobilenetv2_cityscapes.yaml
--use_gpu
--use_mpio
\
SLIM.NAS_PORT 23333
\
SLIM.NAS_PORT 23333
\
SLIM.NAS_ADDRESS
""
\
SLIM.NAS_ADDRESS
""
\
SLIM.NAS_SEARCH_STEPS 2
\
SLIM.NAS_SEARCH_STEPS 2
\
...
...
slim/nas/mobilenetv2_search_space.py
浏览文件 @
353e7529
...
@@ -180,7 +180,7 @@ class MobileNetV2SpaceSeg(SearchSpaceBase):
...
@@ -180,7 +180,7 @@ class MobileNetV2SpaceSeg(SearchSpaceBase):
c
=
int
(
c
*
self
.
scale
),
c
=
int
(
c
*
self
.
scale
),
n
=
n
,
n
=
n
,
s
=
s
,
s
=
s
,
k
=
k
,
k
=
int
(
k
)
,
name
=
'mobilenetv2_conv'
+
str
(
i
))
name
=
'mobilenetv2_conv'
+
str
(
i
))
in_c
=
int
(
c
*
self
.
scale
)
in_c
=
int
(
c
*
self
.
scale
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录