Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
bb6d5356
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,发现更多精彩内容 >>
You need to sign in or sign up before continuing.
提交
bb6d5356
编写于
10月 11, 2019
作者:
L
Liufang Sang
提交者:
whs
10月 11, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix params filename, pretrain model path (#3513)
上级
037ecc2c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
7 deletion
+7
-7
slim/quantization/README.md
slim/quantization/README.md
+3
-3
slim/quantization/freeze.py
slim/quantization/freeze.py
+3
-3
slim/quantization/yolov3_mobilenet_v1_voc.yml
slim/quantization/yolov3_mobilenet_v1_voc.yml
+1
-1
未找到文件。
slim/quantization/README.md
浏览文件 @
bb6d5356
...
@@ -121,17 +121,17 @@ QuantizationFreezePass主要用于改变IrGraph中量化op和反量化op的顺
...
@@ -121,17 +121,17 @@ QuantizationFreezePass主要用于改变IrGraph中量化op和反量化op的顺
python eval.py --model_path ${checkpoint_path}/${epoch_id}/eval_model/ --model_name __model__ --params_name __params__ -c yolov3_mobilenet_v1_voc.yml
python eval.py --model_path ${checkpoint_path}/${epoch_id}/eval_model/ --model_name __model__ --params_name __params__ -c yolov3_mobilenet_v1_voc.yml
```
```
在评估之后,选取效果最好的epoch的模型,可使用脚本
<a
href=
'./freeze.py'
>
slim/quantization/freeze.py
</a>
将该模型转化为以上介绍的三种模型:
float
模型,int8模型,mobile模型,需要配置的参数为:
在评估之后,选取效果最好的epoch的模型,可使用脚本
<a
href=
'./freeze.py'
>
slim/quantization/freeze.py
</a>
将该模型转化为以上介绍的三种模型:
FP32
模型,int8模型,mobile模型,需要配置的参数为:
-
model_path, 加载的模型路径,
`为${checkpoint_path}/${epoch_id}/eval_model/`
-
model_path, 加载的模型路径,
`为${checkpoint_path}/${epoch_id}/eval_model/`
-
weight_quant_type 模型参数的量化方式,和配置文件中的类型保持一致
-
weight_quant_type 模型参数的量化方式,和配置文件中的类型保持一致
-
save_path
`FP32`
,
`8-bit`
,
`mobile`
模型的保存路径,分别为
`${save_path}/float/`
,
`${save_path}/int8/`
,
`${save_path}/mobile/`
-
save_path
`FP32`
,
`8-bit`
,
`mobile`
模型的保存路径,分别为
`${save_path}/float/`
,
`${save_path}/int8/`
,
`${save_path}/mobile/`
### 最终评估模型
### 最终评估模型
最终使用的评估模型是
float
模型,使用脚本
<a
href=
"./eval.py"
>
slim/quantization/eval.py
</a>
中为使用该模型在评估数据集上做评估的示例。
最终使用的评估模型是
FP32
模型,使用脚本
<a
href=
"./eval.py"
>
slim/quantization/eval.py
</a>
中为使用该模型在评估数据集上做评估的示例。
运行命令为:
运行命令为:
```
```
python eval.py --model_path ${float_model_path} --model_name model --params_name
param
s -c yolov3_mobilenet_v1_voc.yml
python eval.py --model_path ${float_model_path} --model_name model --params_name
weight
s -c yolov3_mobilenet_v1_voc.yml
```
```
## 预测
## 预测
...
...
slim/quantization/freeze.py
浏览文件 @
bb6d5356
...
@@ -175,7 +175,7 @@ def main():
...
@@ -175,7 +175,7 @@ def main():
executor
=
exe
,
executor
=
exe
,
main_program
=
server_program
,
main_program
=
server_program
,
model_filename
=
'model'
,
model_filename
=
'model'
,
params_filename
=
'
param
s'
)
params_filename
=
'
weight
s'
)
logger
.
info
(
"convert the weights into int8 type"
)
logger
.
info
(
"convert the weights into int8 type"
)
convert_int8_pass
=
ConvertToInt8Pass
(
convert_int8_pass
=
ConvertToInt8Pass
(
...
@@ -190,7 +190,7 @@ def main():
...
@@ -190,7 +190,7 @@ def main():
executor
=
exe
,
executor
=
exe
,
main_program
=
server_int8_program
,
main_program
=
server_int8_program
,
model_filename
=
'model'
,
model_filename
=
'model'
,
params_filename
=
'
param
s'
)
params_filename
=
'
weight
s'
)
logger
.
info
(
"convert the freezed pass to paddle-lite execution"
)
logger
.
info
(
"convert the freezed pass to paddle-lite execution"
)
mobile_pass
=
TransformForMobilePass
()
mobile_pass
=
TransformForMobilePass
()
...
@@ -203,7 +203,7 @@ def main():
...
@@ -203,7 +203,7 @@ def main():
executor
=
exe
,
executor
=
exe
,
main_program
=
mobile_program
,
main_program
=
mobile_program
,
model_filename
=
'model'
,
model_filename
=
'model'
,
params_filename
=
'
param
s'
)
params_filename
=
'
weight
s'
)
...
...
slim/quantization/yolov3_mobilenet_v1_voc.yml
浏览文件 @
bb6d5356
...
@@ -9,7 +9,7 @@ save_dir: output
...
@@ -9,7 +9,7 @@ save_dir: output
snapshot_iter
:
2000
snapshot_iter
:
2000
metric
:
VOC
metric
:
VOC
map_type
:
11point
map_type
:
11point
pretrain_weights
:
http
://paddle-imagenet-models-name.bj.bcebos.com/MobileNetV1_pretrained
.tar
pretrain_weights
:
http
s://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v1_voc
.tar
weights
:
output/yolov3_mobilenet_v1_voc/model_final
weights
:
output/yolov3_mobilenet_v1_voc/model_final
num_classes
:
20
num_classes
:
20
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录