Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
a2f24762
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看板
未验证
提交
a2f24762
编写于
12月 21, 2021
作者:
G
Guanghua Yu
提交者:
GitHub
12月 21, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix voc dataset collact_batch (#4966)
上级
1f8f8539
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
5 deletion
+15
-5
ppdet/engine/trainer.py
ppdet/engine/trainer.py
+9
-2
ppdet/modeling/backbones/lcnet.py
ppdet/modeling/backbones/lcnet.py
+2
-2
ppdet/modeling/backbones/shufflenet_v2.py
ppdet/modeling/backbones/shufflenet_v2.py
+4
-1
未找到文件。
ppdet/engine/trainer.py
浏览文件 @
a2f24762
...
...
@@ -111,8 +111,12 @@ class Trainer(object):
if
self
.
mode
==
'eval'
:
self
.
_eval_batch_sampler
=
paddle
.
io
.
BatchSampler
(
self
.
dataset
,
batch_size
=
self
.
cfg
.
EvalReader
[
'batch_size'
])
self
.
loader
=
create
(
'{}Reader'
.
format
(
self
.
mode
.
capitalize
()))(
self
.
dataset
,
cfg
.
worker_num
,
self
.
_eval_batch_sampler
)
reader_name
=
'{}Reader'
.
format
(
self
.
mode
.
capitalize
())
# If metric is VOC, need to be set collate_batch=False.
if
cfg
.
metric
==
'VOC'
:
cfg
[
reader_name
][
'collate_batch'
]
=
False
self
.
loader
=
create
(
reader_name
)(
self
.
dataset
,
cfg
.
worker_num
,
self
.
_eval_batch_sampler
)
# TestDataset build after user set images, skip loader creation here
# build optimizer in train mode
...
...
@@ -444,6 +448,9 @@ class Trainer(object):
paddle
.
io
.
BatchSampler
(
self
.
_eval_dataset
,
batch_size
=
self
.
cfg
.
EvalReader
[
'batch_size'
])
# If metric is VOC, need to be set collate_batch=False.
if
self
.
cfg
.
metric
==
'VOC'
:
self
.
cfg
[
'EvalReader'
][
'collate_batch'
]
=
False
self
.
_eval_loader
=
create
(
'EvalReader'
)(
self
.
_eval_dataset
,
self
.
cfg
.
worker_num
,
...
...
ppdet/modeling/backbones/lcnet.py
浏览文件 @
a2f24762
...
...
@@ -19,7 +19,7 @@ from __future__ import print_function
import
paddle
import
paddle.nn
as
nn
from
paddle
import
ParamAttr
from
paddle.nn
import
AdaptiveAvgPool2D
,
BatchNorm
,
Conv2D
,
Dropout
,
Linear
from
paddle.nn
import
AdaptiveAvgPool2D
,
Conv2D
from
paddle.regularizer
import
L2Decay
from
paddle.nn.initializer
import
KaimingNormal
...
...
@@ -81,7 +81,7 @@ class ConvBNLayer(nn.Layer):
weight_attr
=
ParamAttr
(
initializer
=
KaimingNormal
()),
bias_attr
=
False
)
self
.
bn
=
BatchNorm2D
(
self
.
bn
=
nn
.
BatchNorm2D
(
num_filters
,
weight_attr
=
ParamAttr
(
regularizer
=
L2Decay
(
0.0
)),
bias_attr
=
ParamAttr
(
regularizer
=
L2Decay
(
0.0
)))
...
...
ppdet/modeling/backbones/shufflenet_v2.py
浏览文件 @
a2f24762
...
...
@@ -19,7 +19,8 @@ from __future__ import print_function
import
paddle
import
paddle.nn
as
nn
from
paddle
import
ParamAttr
from
paddle.nn
import
Conv2D
,
MaxPool2D
,
AdaptiveAvgPool2D
,
BatchNorm
import
paddle.nn.functional
as
F
from
paddle.nn
import
Conv2D
,
MaxPool2D
,
AdaptiveAvgPool2D
,
BatchNorm2D
from
paddle.nn.initializer
import
KaimingNormal
from
paddle.regularizer
import
L2Decay
...
...
@@ -55,6 +56,8 @@ class ConvBNLayer(nn.Layer):
out_channels
,
weight_attr
=
ParamAttr
(
regularizer
=
L2Decay
(
0.0
)),
bias_attr
=
ParamAttr
(
regularizer
=
L2Decay
(
0.0
)))
if
act
==
"hard_swish"
:
act
=
'hardswish'
self
.
act
=
act
def
forward
(
self
,
inputs
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录