Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
d3367e13
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d3367e13
编写于
4月 17, 2021
作者:
W
wangguanzhong
提交者:
GitHub
4月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
simplify log of loading weights (#2674)
上级
e3049ab2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
20 deletion
+13
-20
README_en.md
README_en.md
+1
-1
ppdet/utils/checkpoint.py
ppdet/utils/checkpoint.py
+12
-19
未找到文件。
README_en.md
浏览文件 @
d3367e13
...
@@ -188,7 +188,7 @@ The relationship between COCO mAP and FPS on Tesla V100 of representative models
...
@@ -188,7 +188,7 @@ The relationship between COCO mAP and FPS on Tesla V100 of representative models
-
`PP-YOLO`
achieves mAP of 45.9% on COCO and 72.9FPS on Tesla V100. Both precision and speed surpass
[
YOLOv4
](
https://arxiv.org/abs/2004.10934
)
-
`PP-YOLO`
achieves mAP of 45.9% on COCO and 72.9FPS on Tesla V100. Both precision and speed surpass
[
YOLOv4
](
https://arxiv.org/abs/2004.10934
)
-
`PP-YOLO v2`
is optimized version of
`PP-YOLO`
which has mAP of 49.5% and 6
0
FPS on Tesla V100
-
`PP-YOLO v2`
is optimized version of
`PP-YOLO`
which has mAP of 49.5% and 6
8.9
FPS on Tesla V100
-
All these models can be get in
[
Model Zoo
](
#ModelZoo
)
-
All these models can be get in
[
Model Zoo
](
#ModelZoo
)
...
...
ppdet/utils/checkpoint.py
浏览文件 @
d3367e13
...
@@ -157,28 +157,21 @@ def load_pretrain_weight(model, pretrain_weight):
...
@@ -157,28 +157,21 @@ def load_pretrain_weight(model, pretrain_weight):
weights_path
=
path
+
'.pdparams'
weights_path
=
path
+
'.pdparams'
param_state_dict
=
paddle
.
load
(
weights_path
)
param_state_dict
=
paddle
.
load
(
weights_path
)
lack_backbone_weights_cnt
=
0
ignore_weights
=
set
()
lack_modules
=
set
()
for
name
,
weight
in
model
_dict
.
items
():
for
name
,
weight
in
param_state
_dict
.
items
():
if
name
in
param_state
_dict
.
keys
():
if
name
in
model
_dict
.
keys
():
if
weight
.
shape
!=
list
(
param_state
_dict
[
name
].
shape
):
if
list
(
weight
.
shape
)
!=
list
(
model
_dict
[
name
].
shape
):
logger
.
info
(
logger
.
info
(
'{} not used, shape {} unmatched with {} in model.'
.
format
(
'{} not used, shape {} unmatched with {} in model.'
.
format
(
name
,
list
(
param_state_dict
[
name
].
shape
),
weight
.
shape
))
name
,
weight
.
shape
,
list
(
model_dict
[
name
].
shape
)
))
param_state_dict
.
pop
(
name
,
Non
e
)
ignore_weights
.
add
(
nam
e
)
else
:
else
:
lack_modules
.
add
(
name
.
split
(
'.'
)[
0
])
logger
.
info
(
'Redundant weight {} and ignore it.'
.
format
(
name
))
if
name
.
find
(
'backbone'
)
>=
0
:
ignore_weights
.
add
(
name
)
logger
.
info
(
'Lack backbone weights: {}'
.
format
(
name
))
lack_backbone_weights_cnt
+=
1
for
weight
in
ignore_weights
:
param_state_dict
.
pop
(
weight
,
None
)
if
lack_backbone_weights_cnt
>
0
:
logger
.
info
(
'Lack {} weights in backbone.'
.
format
(
lack_backbone_weights_cnt
))
if
len
(
lack_modules
)
>
0
:
logger
.
info
(
'Lack weights of modules: {}'
.
format
(
', '
.
join
(
list
(
lack_modules
))))
model
.
set_dict
(
param_state_dict
)
model
.
set_dict
(
param_state_dict
)
logger
.
info
(
'Finish loading model weights: {}'
.
format
(
weights_path
))
logger
.
info
(
'Finish loading model weights: {}'
.
format
(
weights_path
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录