Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
5a70c22a
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看板
未验证
提交
5a70c22a
编写于
5月 17, 2021
作者:
K
Kaipeng Deng
提交者:
GitHub
5月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix config dependence & fix python 3.8/3.9 install (#2987)
* fix config dependence & fix python 3.8/3.9 install
上级
aacb294d
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
11 addition
and
10 deletion
+11
-10
ppdet/engine/callbacks.py
ppdet/engine/callbacks.py
+1
-1
ppdet/engine/trainer.py
ppdet/engine/trainer.py
+6
-7
requirements.txt
requirements.txt
+2
-2
setup.py
setup.py
+2
-0
未找到文件。
ppdet/engine/callbacks.py
浏览文件 @
5a70c22a
...
@@ -217,7 +217,7 @@ class VisualDLWriter(Callback):
...
@@ -217,7 +217,7 @@ class VisualDLWriter(Callback):
logger
.
error
(
'visualdl not found, plaese install visualdl. '
logger
.
error
(
'visualdl not found, plaese install visualdl. '
'for example: `pip install visualdl`.'
)
'for example: `pip install visualdl`.'
)
raise
e
raise
e
self
.
vdl_writer
=
LogWriter
(
model
.
cfg
.
vdl_log_dir
)
self
.
vdl_writer
=
LogWriter
(
model
.
cfg
.
get
(
'vdl_log_dir'
,
'vdl_log_dir/scalar'
)
)
self
.
vdl_loss_step
=
0
self
.
vdl_loss_step
=
0
self
.
vdl_mAP_step
=
0
self
.
vdl_mAP_step
=
0
self
.
vdl_image_step
=
0
self
.
vdl_image_step
=
0
...
...
ppdet/engine/trainer.py
浏览文件 @
5a70c22a
...
@@ -116,7 +116,7 @@ class Trainer(object):
...
@@ -116,7 +116,7 @@ class Trainer(object):
def
_init_callbacks
(
self
):
def
_init_callbacks
(
self
):
if
self
.
mode
==
'train'
:
if
self
.
mode
==
'train'
:
self
.
_callbacks
=
[
LogPrinter
(
self
),
Checkpointer
(
self
)]
self
.
_callbacks
=
[
LogPrinter
(
self
),
Checkpointer
(
self
)]
if
'use_vdl'
in
self
.
cfg
and
self
.
cfg
.
use_vdl
:
if
self
.
cfg
.
get
(
'use_vdl'
,
False
)
:
self
.
_callbacks
.
append
(
VisualDLWriter
(
self
))
self
.
_callbacks
.
append
(
VisualDLWriter
(
self
))
self
.
_compose_callback
=
ComposeCallback
(
self
.
_callbacks
)
self
.
_compose_callback
=
ComposeCallback
(
self
.
_callbacks
)
elif
self
.
mode
==
'eval'
:
elif
self
.
mode
==
'eval'
:
...
@@ -124,7 +124,7 @@ class Trainer(object):
...
@@ -124,7 +124,7 @@ class Trainer(object):
if
self
.
cfg
.
metric
==
'WiderFace'
:
if
self
.
cfg
.
metric
==
'WiderFace'
:
self
.
_callbacks
.
append
(
WiferFaceEval
(
self
))
self
.
_callbacks
.
append
(
WiferFaceEval
(
self
))
self
.
_compose_callback
=
ComposeCallback
(
self
.
_callbacks
)
self
.
_compose_callback
=
ComposeCallback
(
self
.
_callbacks
)
elif
self
.
mode
==
'test'
and
'use_vdl'
in
self
.
cfg
and
self
.
cfg
.
use_vdl
:
elif
self
.
mode
==
'test'
and
self
.
cfg
.
get
(
'use_vdl'
,
False
)
:
self
.
_callbacks
=
[
VisualDLWriter
(
self
)]
self
.
_callbacks
=
[
VisualDLWriter
(
self
)]
self
.
_compose_callback
=
ComposeCallback
(
self
.
_callbacks
)
self
.
_compose_callback
=
ComposeCallback
(
self
.
_callbacks
)
else
:
else
:
...
@@ -141,8 +141,7 @@ class Trainer(object):
...
@@ -141,8 +141,7 @@ class Trainer(object):
bias
=
self
.
cfg
[
'bias'
]
if
'bias'
in
self
.
cfg
else
0
bias
=
self
.
cfg
[
'bias'
]
if
'bias'
in
self
.
cfg
else
0
output_eval
=
self
.
cfg
[
'output_eval'
]
\
output_eval
=
self
.
cfg
[
'output_eval'
]
\
if
'output_eval'
in
self
.
cfg
else
None
if
'output_eval'
in
self
.
cfg
else
None
save_prediction_only
=
self
.
cfg
[
'save_prediction_only'
]
\
save_prediction_only
=
self
.
cfg
.
get
(
'save_prediction_only'
,
False
)
if
'save_prediction_only'
in
self
.
cfg
else
False
# pass clsid2catid info to metric instance to avoid multiple loading
# pass clsid2catid info to metric instance to avoid multiple loading
# annotation file
# annotation file
...
@@ -253,7 +252,7 @@ class Trainer(object):
...
@@ -253,7 +252,7 @@ class Trainer(object):
self
.
_reset_metrics
()
self
.
_reset_metrics
()
model
=
self
.
model
model
=
self
.
model
if
self
.
cfg
.
fleet
:
if
self
.
cfg
.
get
(
'fleet'
,
False
)
:
model
=
fleet
.
distributed_model
(
model
)
model
=
fleet
.
distributed_model
(
model
)
self
.
optimizer
=
fleet
.
distributed_optimizer
(
self
.
optimizer
=
fleet
.
distributed_optimizer
(
self
.
optimizer
).
user_defined_optimizer
self
.
optimizer
).
user_defined_optimizer
...
@@ -264,7 +263,7 @@ class Trainer(object):
...
@@ -264,7 +263,7 @@ class Trainer(object):
self
.
model
,
find_unused_parameters
=
find_unused_parameters
)
self
.
model
,
find_unused_parameters
=
find_unused_parameters
)
# initial fp16
# initial fp16
if
self
.
cfg
.
fp16
:
if
self
.
cfg
.
get
(
'fp16'
,
False
)
:
scaler
=
amp
.
GradScaler
(
scaler
=
amp
.
GradScaler
(
enable
=
self
.
cfg
.
use_gpu
,
init_loss_scaling
=
1024
)
enable
=
self
.
cfg
.
use_gpu
,
init_loss_scaling
=
1024
)
...
@@ -292,7 +291,7 @@ class Trainer(object):
...
@@ -292,7 +291,7 @@ class Trainer(object):
self
.
status
[
'step_id'
]
=
step_id
self
.
status
[
'step_id'
]
=
step_id
self
.
_compose_callback
.
on_step_begin
(
self
.
status
)
self
.
_compose_callback
.
on_step_begin
(
self
.
status
)
if
self
.
cfg
.
fp16
:
if
self
.
cfg
.
get
(
'fp16'
,
False
)
:
with
amp
.
auto_cast
(
enable
=
self
.
cfg
.
use_gpu
):
with
amp
.
auto_cast
(
enable
=
self
.
cfg
.
use_gpu
):
# model forward
# model forward
outputs
=
model
(
data
)
outputs
=
model
(
data
)
...
...
requirements.txt
浏览文件 @
5a70c22a
tqdm
tqdm
typeguard
; python_version >= '3.4'
typeguard
; python_version >= '3.4'
visualdl
>=2.1.0
visualdl
>=2.1.0
; python_version <= '3.7'
opencv-python
opencv-python
PyYAML
PyYAML
shapely
shapely
...
...
setup.py
浏览文件 @
5a70c22a
...
@@ -87,6 +87,8 @@ if __name__ == "__main__":
...
@@ -87,6 +87,8 @@ if __name__ == "__main__":
'Programming Language :: Python :: 3.5'
,
'Programming Language :: Python :: 3.5'
,
'Programming Language :: Python :: 3.6'
,
'Programming Language :: Python :: 3.6'
,
'Programming Language :: Python :: 3.7'
,
'Topic :: Utilities'
'Programming Language :: Python :: 3.7'
,
'Topic :: Utilities'
'Programming Language :: Python :: 3.8'
,
'Topic :: Utilities'
'Programming Language :: Python :: 3.9'
,
'Topic :: Utilities'
],
],
license
=
'Apache License 2.0'
,
license
=
'Apache License 2.0'
,
ext_modules
=
[])
ext_modules
=
[])
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录