Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSlim
提交
d2c912d8
P
PaddleSlim
项目概览
PaddlePaddle
/
PaddleSlim
1 年多 前同步成功
通知
51
Star
1434
Fork
344
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
16
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSlim
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
16
合并请求
16
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d2c912d8
编写于
11月 07, 2019
作者:
Y
yangfukui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add ignore pyc files; quant test
上级
268e88b4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
6 deletion
+7
-6
.gitignore
.gitignore
+1
-0
paddleslim/quant/test/models/resnet.py
paddleslim/quant/test/models/resnet.py
+1
-1
paddleslim/quant/test/quanter_test.py
paddleslim/quant/test/quanter_test.py
+2
-2
paddleslim/quant/test/run_quant.sh
paddleslim/quant/test/run_quant.sh
+3
-3
未找到文件。
.gitignore
浏览文件 @
d2c912d8
*.egg-info
*.pyc
build/
./dist/
paddleslim/quant/test/models/resnet.py
浏览文件 @
d2c912d8
...
...
@@ -27,7 +27,7 @@ class ResNet():
self
.
layers
=
layers
self
.
prefix_name
=
prefix_name
def
net
(
self
,
input
,
class_dim
=
1000
,
conv1_name
=
'conv1'
,
fc_name
=
None
):
def
net
(
self
,
input
,
class_dim
=
1000
,
conv1_name
=
'conv1'
,
fc_name
=
'res_fc'
):
layers
=
self
.
layers
prefix_name
=
self
.
prefix_name
if
self
.
prefix_name
is
''
else
self
.
prefix_name
+
'_'
supported_layers
=
[
34
,
50
,
101
,
152
]
...
...
paddleslim/quant/test/quanter_test.py
浏览文件 @
d2c912d8
...
...
@@ -189,7 +189,7 @@ def train(args):
'activation_quantize_type'
:
'abs_max'
,
# weight quantize bit num, default is 8
'weight_bits'
:
8
,
# activation quantize bit num
,
default is 8
# activation quantize bit num
,
default is 8
'activation_bits'
:
8
,
# op of name_scope in not_quant_pattern list, will not quantized
'not_quant_pattern'
:
[
'skip_quant'
],
...
...
@@ -199,7 +199,7 @@ def train(args):
'dtype'
:
'int8'
,
# window size for 'range_abs_max' quantization. defaulf is 10000
'window_size'
:
10000
,
# The decay coefficient of moving average
,
default is 0.9
# The decay coefficient of moving average
,
default is 0.9
'moving_rate'
:
0.9
,
# if set quant_weight_only True, then only quantize parameters of layers which need quantization,
# and insert anti-quantization op for parameters of these layers.
...
...
paddleslim/quant/test/run_quant.sh
浏览文件 @
d2c912d8
#!/usr/bin/env bash
source
activate py27_paddle1.6
#MobileNet v1:
python quanter_test.py
\
--model
=
MobileNet
\
--pretrained_fp32_model
=
${
pretrain_dir
}
/MobileNetV1_pretrained
\
--pretrained_fp32_model
=
'../../pretrain/MobileNetV1_pretrained/'
\
--use_gpu
=
True
\
--data_dir
=
${
data_dir
}
\
--data_dir
=
'/home/ssd8/wsz/tianfei01/traindata/imagenet/'
\
--batch_size
=
256
\
--total_images
=
1281167
\
--class_dim
=
1000
\
...
...
@@ -17,7 +18,6 @@ python quanter_test.py \
--act_quant_type
=
abs_max
\
--wt_quant_type
=
abs_max
#ResNet50:
#python quanter_test.py \
# --model=ResNet50 \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录