Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
80f1f748
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
80f1f748
编写于
5月 20, 2021
作者:
G
Guanghua Yu
提交者:
GitHub
5月 20, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update slim models and benchmark (#3077)
* update slim models and benchmark
上级
571dcb34
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
183 addition
and
29 deletion
+183
-29
configs/slim/README.md
configs/slim/README.md
+52
-22
configs/slim/prune/ppyolo_mbv3_large_prune_fpgm.yml
configs/slim/prune/ppyolo_mbv3_large_prune_fpgm.yml
+9
-0
configs/slim/prune/ppyolo_r50vd_prune_fpgm.yml
configs/slim/prune/ppyolo_r50vd_prune_fpgm.yml
+13
-0
configs/slim/prune/yolov3_darknet_prune_fpgm.yml
configs/slim/prune/yolov3_darknet_prune_fpgm.yml
+13
-0
configs/slim/quant/ppyolo_mbv3_large_qat.yml
configs/slim/quant/ppyolo_mbv3_large_qat.yml
+16
-0
configs/slim/quant/ppyolo_r50vd_qat_pact.yml
configs/slim/quant/ppyolo_r50vd_qat_pact.yml
+39
-0
configs/slim/quant/ppyolov2_r50vd_dcn_qat.yml
configs/slim/quant/ppyolov2_r50vd_dcn_qat.yml
+33
-0
configs/slim/quant/yolov3_mobilenet_v3_qat.yml
configs/slim/quant/yolov3_mobilenet_v3_qat.yml
+5
-5
deploy/README.md
deploy/README.md
+1
-1
ppdet/engine/trainer.py
ppdet/engine/trainer.py
+1
-1
ppdet/slim/__init__.py
ppdet/slim/__init__.py
+1
-0
未找到文件。
configs/slim/README.md
浏览文件 @
80f1f748
此差异已折叠。
点击以展开。
configs/slim/prune/ppyolo_mbv3_large_prune_fpgm.yml
0 → 100644
浏览文件 @
80f1f748
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/ppyolo_mbv3_large_coco.pdparams
slim
:
Pruner
Pruner
:
criterion
:
fpgm
pruned_params
:
[
'
conv2d_62.w_0'
,
'
conv2d_63.w_0'
,
'
conv2d_64.w_0'
,
'
conv2d_65.w_0'
,
'
conv2d_66.w_0'
,
'
conv2d_67.w_0'
]
pruned_ratios
:
[
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
]
print_params
:
True
configs/slim/prune/ppyolo_r50vd_prune_fpgm.yml
0 → 100644
浏览文件 @
80f1f748
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/ppyolo_r50vd_dcn_1x_coco.pdparams
slim
:
Pruner
Pruner
:
criterion
:
fpgm
pruned_params
:
[
'
conv2d_56.w_0'
,
'
conv2d_57.w_0'
,
'
conv2d_58.w_0'
,
'
conv2d_59.w_0'
,
'
conv2d_60.w_0'
,
'
conv2d_61.w_0'
,
'
conv2d_63.w_0'
,
'
conv2d_64.w_0'
,
'
conv2d_65.w_0'
,
'
conv2d_66.w_0'
,
'
conv2d_67.w_0'
,
'
conv2d_68.w_0'
,
'
conv2d_70.w_0'
,
'
conv2d_71.w_0'
,
'
conv2d_72.w_0'
,
'
conv2d_73.w_0'
,
'
conv2d_74.w_0'
,
'
conv2d_75.w_0'
]
pruned_ratios
:
[
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.875
,
0.875
,
0.875
,
0.875
,
0.875
,
0.875
]
print_params
:
False
configs/slim/prune/yolov3_darknet_prune_fpgm.yml
0 → 100644
浏览文件 @
80f1f748
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/yolov3_darknet53_270e_coco.pdparams
slim
:
Pruner
Pruner
:
criterion
:
fpgm
pruned_params
:
[
'
conv2d_52.w_0'
,
'
conv2d_53.w_0'
,
'
conv2d_54.w_0'
,
'
conv2d_55.w_0'
,
'
conv2d_56.w_0'
,
'
conv2d_57.w_0'
,
'
conv2d_59.w_0'
,
'
conv2d_60.w_0'
,
'
conv2d_61.w_0'
,
'
conv2d_62.w_0'
,
'
conv2d_63.w_0'
,
'
conv2d_64.w_0'
,
'
conv2d_66.w_0'
,
'
conv2d_67.w_0'
,
'
conv2d_68.w_0'
,
'
conv2d_69.w_0'
,
'
conv2d_70.w_0'
,
'
conv2d_71.w_0'
]
pruned_ratios
:
[
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.75
,
0.875
,
0.875
,
0.875
,
0.875
,
0.875
,
0.875
]
print_params
:
True
configs/slim/quant/ppyolo_mbv3_large_qat.yml
0 → 100644
浏览文件 @
80f1f748
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/ppyolo_mbv3_large_coco.pdparams
slim
:
QAT
QAT
:
quant_config
:
{
'
weight_quantize_type'
:
'
channel_wise_abs_max'
,
'
activation_quantize_type'
:
'
moving_average_abs_max'
,
'
weight_bits'
:
8
,
'
activation_bits'
:
8
,
'
dtype'
:
'
int8'
,
'
window_size'
:
10000
,
'
moving_rate'
:
0.99
,
'
quantizable_layer_type'
:
[
'
Conv2D'
,
'
Linear'
]}
print_model
:
True
PPYOLOFPN
:
in_channels
:
[
160
,
368
]
coord_conv
:
true
conv_block_num
:
0
spp
:
true
drop_block
:
false
configs/slim/quant/ppyolo_r50vd_qat_pact.yml
0 → 100644
浏览文件 @
80f1f748
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/ppyolo_r50vd_dcn_1x_coco.pdparams
slim
:
QAT
QAT
:
quant_config
:
{
'
activation_preprocess_type'
:
'
PACT'
,
'
weight_quantize_type'
:
'
channel_wise_abs_max'
,
'
activation_quantize_type'
:
'
moving_average_abs_max'
,
'
weight_bits'
:
8
,
'
activation_bits'
:
8
,
'
dtype'
:
'
int8'
,
'
window_size'
:
10000
,
'
moving_rate'
:
0.9
,
'
quantizable_layer_type'
:
[
'
Conv2D'
,
'
Linear'
]}
print_model
:
True
epoch
:
50
LearningRate
:
base_lr
:
0.0005
schedulers
:
-
!PiecewiseDecay
gamma
:
0.1
milestones
:
-
30
-
45
-
!LinearWarmup
start_factor
:
0.
steps
:
1000
OptimizerBuilder
:
optimizer
:
momentum
:
0.9
type
:
Momentum
regularizer
:
factor
:
0.0005
type
:
L2
PPYOLOFPN
:
coord_conv
:
true
block_size
:
3
keep_prob
:
0.9
spp
:
true
drop_block
:
false
configs/slim/quant/ppyolov2_r50vd_dcn_qat.yml
0 → 100644
浏览文件 @
80f1f748
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/ppyolov2_r50vd_dcn_365e_coco.pdparams
slim
:
QAT
QAT
:
quant_config
:
{
'
activation_preprocess_type'
:
'
PACT'
,
'
weight_quantize_type'
:
'
channel_wise_abs_max'
,
'
activation_quantize_type'
:
'
moving_average_abs_max'
,
'
weight_bits'
:
8
,
'
activation_bits'
:
8
,
'
dtype'
:
'
int8'
,
'
window_size'
:
10000
,
'
moving_rate'
:
0.9
,
'
quantizable_layer_type'
:
[
'
Conv2D'
,
'
Linear'
]}
print_model
:
True
epoch
:
50
snapshot_epoch
:
8
LearningRate
:
base_lr
:
0.0005
schedulers
:
-
!PiecewiseDecay
gamma
:
0.1
milestones
:
-
30
-
45
-
!LinearWarmup
start_factor
:
0.
steps
:
2000
TrainReader
:
batch_size
:
8
PPYOLOPAN
:
drop_block
:
false
block_size
:
3
keep_prob
:
0.9
spp
:
true
configs/slim/quant/yolov3_mobilenet_v3_qat.yml
浏览文件 @
80f1f748
...
...
@@ -4,21 +4,21 @@ slim: QAT
QAT
:
quant_config
:
{
'
weight
_preprocess_type'
:
'
PACT'
,
'
activation
_preprocess_type'
:
'
PACT'
,
'
weight_quantize_type'
:
'
channel_wise_abs_max'
,
'
activation_quantize_type'
:
'
moving_average_abs_max'
,
'
weight_bits'
:
8
,
'
activation_bits'
:
8
,
'
dtype'
:
'
int8'
,
'
window_size'
:
10000
,
'
moving_rate'
:
0.9
,
'
quantizable_layer_type'
:
[
'
Conv2D'
,
'
Linear'
]}
print_model
:
True
epoch
:
3
0
epoch
:
5
0
LearningRate
:
base_lr
:
0.0001
schedulers
:
-
!PiecewiseDecay
gamma
:
0.1
milestones
:
-
2
5
-
28
-
3
5
-
45
-
!LinearWarmup
start_factor
:
0.
steps
:
2
000
steps
:
1
000
deploy/README.md
浏览文件 @
80f1f748
...
...
@@ -6,7 +6,7 @@
-
`C++`
语言部署 ,支持
`CPU`
、
`GPU`
和
`XPU`
环境,支持在
`Linux`
、
`Windows`
系统下部署,支持
`NV Jetson`
嵌入式设备上部署。请参考文档
[
C++部署
](
cpp/README.md
)
。
-
`TensorRT`
加速:请参考文档
[
TensorRT预测部署教程
](
TENSOR_RT.md
)
-
服务器端部署:使用
[
PaddleServing
](
./serving/README.md
)
部署。
-
手机移动端部署:使用
[
Paddle-Lite
](
https://github.com/PaddlePaddle/Paddle-Lite
)
在手机移动端部署。
-
手机移动端部署:使用
[
Paddle-Lite
](
./lite/README.md
)
在手机移动端部署。
## 1.模型导出
...
...
ppdet/engine/trainer.py
浏览文件 @
80f1f748
...
...
@@ -498,7 +498,7 @@ class Trainer(object):
}]
# dy2st and save model
if
'slim'
not
in
self
.
cfg
or
self
.
cfg
[
'slim'
]
!=
'QAT'
:
if
'slim'
not
in
self
.
cfg
or
self
.
cfg
[
'slim
_type
'
]
!=
'QAT'
:
static_model
=
paddle
.
jit
.
to_static
(
self
.
model
,
input_spec
=
input_spec
)
# NOTE: dy2st do not pruned program, but jit.save will prune program
...
...
ppdet/slim/__init__.py
浏览文件 @
80f1f748
...
...
@@ -53,6 +53,7 @@ def build_slim_model(cfg, slim_cfg, mode='train'):
if
mode
==
'train'
:
load_pretrain_weight
(
model
,
cfg
.
pretrain_weights
)
slim
=
create
(
cfg
.
slim
)
cfg
[
'slim_type'
]
=
cfg
.
slim
cfg
[
'model'
]
=
slim
(
model
)
cfg
[
'slim'
]
=
slim
if
mode
!=
'train'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录