Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
2f0cf6e9
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
大约 1 年 前同步成功
通知
115
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2f0cf6e9
编写于
4月 13, 2020
作者:
W
WuHaobo
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'WuHaobo-fix_download'
上级
2e8b2bc2
514f112b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
144 addition
and
15 deletion
+144
-15
configs/pretrained.list
configs/pretrained.list
+117
-0
docs/zh_CN/extension/paddle_quantization.md
docs/zh_CN/extension/paddle_quantization.md
+1
-1
ppcls/modeling/__init__.py
ppcls/modeling/__init__.py
+1
-1
ppcls/modeling/utils.py
ppcls/modeling/utils.py
+2
-3
ppcls/utils/check.py
ppcls/utils/check.py
+2
-1
ppcls/utils/model_zoo.py
ppcls/utils/model_zoo.py
+21
-8
tools/download.py
tools/download.py
+0
-1
未找到文件。
configs/pretrained.list
0 → 100644
浏览文件 @
2f0cf6e9
ResNet18
ResNet34
ResNet50
ResNet101
ResNet152
ResNet50_vc
ResNet18_vd
ResNet34_vd
ResNet50_vd
ResNet50_vd_v2
ResNet101_vd
ResNet152_vd
ResNet200_vd
ResNet50_vd_ssld
MobileNetV3_large_x0_35
MobileNetV3_large_x0_5
MobileNetV3_large_x0_75
MobileNetV3_large_x1_0
MobileNetV3_large_x1_25
MobileNetV3_small_x0_35
MobileNetV3_small_x0_5
MobileNetV3_small_x0_75
MobileNetV3_small_x1_0
MobileNetV3_small_x1_25
MobileNetV3_large_x1_0_ssld
MobileNetV3_large_x1_0_ssld_int8
MobileNetV3_small_x1_0_ssld
MobileNetV2_x0_25
MobileNetV2_x0_5
MobileNetV2_x0_75
MobileNetV2
MobileNetV2_x1_5
MobileNetV2_x2_0
MobileNetV2_ssld
MobileNetV1_x0_25
MobileNetV1_x0_5
MobileNetV1_x0_75
MobileNetV1
MobileNetV1_ssld
ShuffleNetV2_x0_25
ShuffleNetV2_x0_33
ShuffleNetV2_x0_5
ShuffleNetV2
ShuffleNetV2_x1_5
ShuffleNetV2_x2_0
ShuffleNetV2_swish
ResNeXt50_32x4d
ResNeXt50_64x4d
ResNeXt101_32x4d
ResNeXt101_64x4d
ResNeXt152_32x4d
ResNeXt152_64x4d
ResNeXt50_vd_32x4d
ResNeXt50_vd_64x4d
ResNeXt101_vd_32x4d
ResNeXt101_vd_64x4d
ResNeXt152_vd_32x4d
ResNeXt152_vd_64x4d
SE_ResNet18_vd
SE_ResNet34_vd
SE_ResNet50_vd
SE_ResNeXt50_32x4d
SE_ResNeXt101_32x4d
SE_ResNeXt50_vd_32x4d
SENet154_vd
Res2Net50_26w_4s
Res2Net50_vd_26w_4s
Res2Net50_14w_8s
Res2Net101_vd_26w_4s
Res2Net200_vd_26w_4s
GoogLeNet
InceptionV4
Xception41
Xception41_deeplab
Xception65
Xception65_deeplab
Xception71
HRNet_W18_C
HRNet_W30_C
HRNet_W32_C
HRNet_W40_C
HRNet_W44_C
HRNet_W48_C
HRNet_W64_C
DPN68
DPN92
DPN98
DPN107
DPN131
DenseNet121
DenseNet161
DenseNet169
DenseNet201
DenseNet264
EfficientNetB0_small
EfficientNetB0
EfficientNetB1
EfficientNetB2
EfficientNetB3
EfficientNetB4
EfficientNetB5
EfficientNetB6
EfficientNetB7
ResNeXt101_32x8d_wsl
ResNeXt101_32x16d_wsl
ResNeXt101_32x32d_wsl
ResNeXt101_32x48d_wsl
Fix_ResNeXt101_32x48d_wsl
AlexNet
SqueezeNet1_0
SqueezeNet1_1
VGG11
VGG13
VGG16
VGG19
DarkNet53
ResNet50_ACNet_deploy
docs/zh_CN/extension/paddle_quantization.md
浏览文件 @
2f0cf6e9
# 模型量化
模型量化是
[
PaddleSlim
](
https://github.com/PaddlePaddle/PaddleSlim
)
的特色功能之一,支持动态和静态两种量化训练方式,对权重全局量化和 Channel-Wise 量化,同时以兼容 Paddle
Mobil
e 的格式保存模型。
模型量化是
[
PaddleSlim
](
https://github.com/PaddlePaddle/PaddleSlim
)
的特色功能之一,支持动态和静态两种量化训练方式,对权重全局量化和 Channel-Wise 量化,同时以兼容 Paddle
-Lit
e 的格式保存模型。
[
PaddleClas
](
https://github.com/PaddlePaddle/PaddleClas
)
使用该量化工具,量化了78.9%的mobilenet_v3_large_x1_0的蒸馏模型, 量化后SD855上预测速度从19.308ms加速到14.395ms,存储大小从21M减小到10M, top1识别准确率75.9%。
具体的训练方法可以参见
[
PaddleSlim 量化训练
](
https://paddlepaddle.github.io/PaddleSlim/quick_start/quant_aware_tutorial.html
)
。
ppcls/modeling/__init__.py
浏览文件 @
2f0cf6e9
...
...
@@ -17,4 +17,4 @@ from . import loss
from
.architectures
import
*
from
.loss
import
*
from
.utils
import
similar_architectures
from
.utils
import
*
ppcls/modeling/utils.py
浏览文件 @
2f0cf6e9
...
...
@@ -12,8 +12,8 @@
#See the License for the specific language governing permissions and
#limitations under the License.
import
types
import
architectures
import
types
from
difflib
import
SequenceMatcher
...
...
@@ -28,12 +28,11 @@ def get_architectures():
return
names
def
similar_architectures
(
name
=
''
,
thresh
=
0.1
,
topk
=
10
):
def
similar_architectures
(
name
=
''
,
names
=
[],
thresh
=
0.1
,
topk
=
10
):
"""
inferred similar architectures
"""
scores
=
[]
names
=
get_architectures
()
for
idx
,
n
in
enumerate
(
names
):
if
n
[:
2
]
==
'__'
:
continue
score
=
SequenceMatcher
(
None
,
n
.
lower
(),
name
.
lower
()).
quick_ratio
()
...
...
ppcls/utils/check.py
浏览文件 @
2f0cf6e9
...
...
@@ -20,6 +20,7 @@ import sys
import
paddle.fluid
as
fluid
from
ppcls.modeling
import
get_architectures
from
ppcls.modeling
import
similar_architectures
from
ppcls.utils
import
logger
...
...
@@ -60,7 +61,7 @@ def check_architecture(architecture):
"""
assert
isinstance
(
architecture
,
str
),
\
(
"the type of architecture({}) should be str"
.
format
(
architecture
))
similar_names
=
similar_architectures
(
architecture
)
similar_names
=
similar_architectures
(
architecture
,
get_architectures
()
)
model_list
=
', '
.
join
(
similar_names
)
err
=
"{} is not exist! Maybe you want: [{}]"
\
""
.
format
(
architecture
,
model_list
)
...
...
ppcls/utils/model_zoo.py
浏览文件 @
2f0cf6e9
...
...
@@ -17,12 +17,13 @@ from __future__ import division
from
__future__
import
print_function
import
os
import
shutil
import
requests
import
tqdm
import
shutil
import
tarfile
import
tqdm
import
zipfile
from
ppcls.modeling
import
similar_architectures
from
ppcls.utils.check
import
check_architecture
from
ppcls.utils
import
logger
...
...
@@ -44,11 +45,7 @@ class ModelNameError(Exception):
""" ModelNameError
"""
def
__init__
(
self
,
message
=
''
,
architecture
=
''
):
similar_names
=
similar_architectures
(
architecture
)
model_list
=
', '
.
join
(
similar_names
)
message
+=
'
\n
{} is not exist.
\n
Maybe you want: [{}]'
.
format
(
architecture
,
model_list
)
def
__init__
(
self
,
message
=
''
):
super
(
ModelNameError
,
self
).
__init__
(
message
)
...
...
@@ -171,8 +168,24 @@ def _decompress(fname):
os
.
remove
(
fname
)
def
_check_pretrained_name
(
architecture
):
assert
isinstance
(
architecture
,
str
),
\
(
"the type of architecture({}) should be str"
.
format
(
architecture
))
with
open
(
'./configs/pretrained.list'
)
as
flist
:
pretrained
=
[
line
.
strip
()
for
line
in
flist
]
similar_names
=
similar_architectures
(
architecture
,
pretrained
)
model_list
=
', '
.
join
(
similar_names
)
err
=
"{} is not exist! Maybe you want: [{}]"
\
""
.
format
(
architecture
,
model_list
)
if
architecture
not
in
similar_names
:
raise
ModelNameError
(
err
)
def
get
(
architecture
,
path
,
decompress
=
True
):
check_architecture
(
architecture
)
"""
Get the pretrained model.
"""
_check_pretrained_name
(
architecture
)
url
=
_get_url
(
architecture
)
fname
=
_download
(
url
,
path
)
if
decompress
:
_decompress
(
fname
)
...
...
tools/download.py
浏览文件 @
2f0cf6e9
...
...
@@ -15,7 +15,6 @@
import
sys
import
argparse
sys
.
path
.
append
(
"../"
)
from
ppcls
import
model_zoo
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录