Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
7d27520a
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
7d27520a
编写于
9月 21, 2022
作者:
G
Guanghua Yu
提交者:
GitHub
9月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ptq unittest (#46345)
上级
3aa6bd57
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
9 deletion
+6
-9
python/paddle/fluid/contrib/slim/tests/test_post_training_quantization_mobilenetv1.py
...slim/tests/test_post_training_quantization_mobilenetv1.py
+6
-9
未找到文件。
python/paddle/fluid/contrib/slim/tests/test_post_training_quantization_mobilenetv1.py
浏览文件 @
7d27520a
...
@@ -146,8 +146,6 @@ class TestPostTrainingQuantization(unittest.TestCase):
...
@@ -146,8 +146,6 @@ class TestPostTrainingQuantization(unittest.TestCase):
os
.
system
(
cmd
)
os
.
system
(
cmd
)
self
.
batch_size
=
1
if
os
.
environ
.
get
(
'DATASET'
)
==
'full'
else
50
self
.
batch_size
=
1
if
os
.
environ
.
get
(
'DATASET'
)
==
'full'
else
50
self
.
sample_iterations
=
50
if
os
.
environ
.
get
(
'DATASET'
)
==
'full'
else
2
self
.
infer_iterations
=
50000
if
os
.
environ
.
get
(
self
.
infer_iterations
=
50000
if
os
.
environ
.
get
(
'DATASET'
)
==
'full'
else
2
'DATASET'
)
==
'full'
else
2
...
@@ -291,7 +289,6 @@ class TestPostTrainingQuantization(unittest.TestCase):
...
@@ -291,7 +289,6 @@ class TestPostTrainingQuantization(unittest.TestCase):
batch_nums
=
10
):
batch_nums
=
10
):
infer_iterations
=
self
.
infer_iterations
infer_iterations
=
self
.
infer_iterations
batch_size
=
self
.
batch_size
batch_size
=
self
.
batch_size
sample_iterations
=
self
.
sample_iterations
model_cache_folder
=
self
.
download_data
(
data_urls
,
data_md5s
,
model
)
model_cache_folder
=
self
.
download_data
(
data_urls
,
data_md5s
,
model
)
...
@@ -302,13 +299,12 @@ class TestPostTrainingQuantization(unittest.TestCase):
...
@@ -302,13 +299,12 @@ class TestPostTrainingQuantization(unittest.TestCase):
infer_iterations
)
infer_iterations
)
print
(
"Start INT8 post training quantization for {0} on {1} images ..."
.
print
(
"Start INT8 post training quantization for {0} on {1} images ..."
.
format
(
model
,
sample_iteration
s
*
batch_size
))
format
(
model
,
batch_num
s
*
batch_size
))
self
.
generate_quantized_model
(
os
.
path
.
join
(
model_cache_folder
,
"model"
),
self
.
generate_quantized_model
(
os
.
path
.
join
(
model_cache_folder
,
"model"
),
quantizable_op_type
,
batch_size
,
quantizable_op_type
,
batch_size
,
algo
,
sample_iterations
,
algo
,
round_type
,
round_type
,
is_full_quantize
,
is_full_quantize
,
is_use_cache_file
,
is_use_cache_file
,
is_optimize_model
,
is_optimize_model
,
batch_nums
,
batch_nums
,
onnx_format
)
onnx_format
)
print
(
"Start INT8 inference for {0} on {1} images ..."
.
format
(
print
(
"Start INT8 inference for {0} on {1} images ..."
.
format
(
model
,
infer_iterations
*
batch_size
))
model
,
infer_iterations
*
batch_size
))
...
@@ -351,6 +347,7 @@ class TestPostTrainingKLForMobilenetv1(TestPostTrainingQuantization):
...
@@ -351,6 +347,7 @@ class TestPostTrainingKLForMobilenetv1(TestPostTrainingQuantization):
is_use_cache_file
=
False
is_use_cache_file
=
False
is_optimize_model
=
True
is_optimize_model
=
True
diff_threshold
=
0.025
diff_threshold
=
0.025
batch_nums
=
3
self
.
run_test
(
model
,
algo
,
round_type
,
data_urls
,
data_md5s
,
self
.
run_test
(
model
,
algo
,
round_type
,
data_urls
,
data_md5s
,
quantizable_op_type
,
is_full_quantize
,
is_use_cache_file
,
quantizable_op_type
,
is_full_quantize
,
is_use_cache_file
,
is_optimize_model
,
diff_threshold
)
is_optimize_model
,
diff_threshold
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录