Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
b4578506
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
b4578506
编写于
9月 21, 2020
作者:
K
Kaipeng Deng
提交者:
GitHub
9月 21, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sync TrainReader.batch to global train_batch_size (#1415)
* sync TrainReader.batch to global train_batch_size
上级
8ef9f6e6
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
19 addition
and
91 deletion
+19
-91
configs/dcn/yolov3_r50vd_dcn.yml
configs/dcn/yolov3_r50vd_dcn.yml
+0
-5
configs/dcn/yolov3_r50vd_dcn_db_iouaware_obj365_pretrained_coco.yml
...n/yolov3_r50vd_dcn_db_iouaware_obj365_pretrained_coco.yml
+0
-1
configs/dcn/yolov3_r50vd_dcn_db_iouloss_obj365_pretrained_coco.yml
...cn/yolov3_r50vd_dcn_db_iouloss_obj365_pretrained_coco.yml
+0
-5
configs/dcn/yolov3_r50vd_dcn_db_obj365_pretrained_coco.yml
configs/dcn/yolov3_r50vd_dcn_db_obj365_pretrained_coco.yml
+0
-5
configs/dcn/yolov3_r50vd_dcn_obj365_pretrained_coco.yml
configs/dcn/yolov3_r50vd_dcn_obj365_pretrained_coco.yml
+0
-5
configs/ppyolo/ppyolo.yml
configs/ppyolo/ppyolo.yml
+0
-1
configs/ppyolo/ppyolo_2x.yml
configs/ppyolo/ppyolo_2x.yml
+0
-1
configs/ppyolo/ppyolo_r18vd.yml
configs/ppyolo/ppyolo_r18vd.yml
+0
-1
configs/ppyolo/ppyolo_test.yml
configs/ppyolo/ppyolo_test.yml
+0
-1
configs/yolov3_darknet.yml
configs/yolov3_darknet.yml
+0
-5
configs/yolov3_darknet_voc.yml
configs/yolov3_darknet_voc.yml
+0
-5
configs/yolov3_darknet_voc_diouloss.yml
configs/yolov3_darknet_voc_diouloss.yml
+0
-1
configs/yolov3_mobilenet_v1.yml
configs/yolov3_mobilenet_v1.yml
+0
-5
configs/yolov3_mobilenet_v1_fruit.yml
configs/yolov3_mobilenet_v1_fruit.yml
+0
-5
configs/yolov3_mobilenet_v1_voc.yml
configs/yolov3_mobilenet_v1_voc.yml
+0
-5
configs/yolov3_mobilenet_v3.yml
configs/yolov3_mobilenet_v3.yml
+0
-5
configs/yolov3_r34.yml
configs/yolov3_r34.yml
+0
-5
configs/yolov3_r34_voc.yml
configs/yolov3_r34_voc.yml
+0
-5
configs/yolov4/yolov4_cspdarknet.yml
configs/yolov4/yolov4_cspdarknet.yml
+0
-5
configs/yolov4/yolov4_cspdarknet_coco.yml
configs/yolov4/yolov4_cspdarknet_coco.yml
+0
-5
configs/yolov4/yolov4_cspdarknet_voc.yml
configs/yolov4/yolov4_cspdarknet_voc.yml
+0
-5
ppdet/core/workspace.py
ppdet/core/workspace.py
+9
-0
ppdet/modeling/losses/yolo_loss.py
ppdet/modeling/losses/yolo_loss.py
+10
-10
未找到文件。
configs/dcn/yolov3_r50vd_dcn.yml
浏览文件 @
b4578506
...
...
@@ -40,11 +40,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
...
...
configs/dcn/yolov3_r50vd_dcn_db_iouaware_obj365_pretrained_coco.yml
浏览文件 @
b4578506
...
...
@@ -44,7 +44,6 @@ YOLOv3Head:
drop_block
:
true
YOLOv3Loss
:
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
use_fine_grained_loss
:
true
...
...
configs/dcn/yolov3_r50vd_dcn_db_iouloss_obj365_pretrained_coco.yml
浏览文件 @
b4578506
...
...
@@ -42,11 +42,6 @@ YOLOv3Head:
drop_block
:
true
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
use_fine_grained_loss
:
true
...
...
configs/dcn/yolov3_r50vd_dcn_db_obj365_pretrained_coco.yml
浏览文件 @
b4578506
...
...
@@ -43,11 +43,6 @@ YOLOv3Head:
keep_prob
:
0.94
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
use_fine_grained_loss
:
true
...
...
configs/dcn/yolov3_r50vd_dcn_obj365_pretrained_coco.yml
浏览文件 @
b4578506
...
...
@@ -41,11 +41,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
use_fine_grained_loss
:
true
...
...
configs/ppyolo/ppyolo.yml
浏览文件 @
b4578506
...
...
@@ -44,7 +44,6 @@ YOLOv3Head:
drop_block
:
true
YOLOv3Loss
:
batch_size
:
24
ignore_thresh
:
0.7
scale_x_y
:
1.05
label_smooth
:
false
...
...
configs/ppyolo/ppyolo_2x.yml
浏览文件 @
b4578506
...
...
@@ -44,7 +44,6 @@ YOLOv3Head:
drop_block
:
true
YOLOv3Loss
:
batch_size
:
24
ignore_thresh
:
0.7
scale_x_y
:
1.05
label_smooth
:
false
...
...
configs/ppyolo/ppyolo_r18vd.yml
浏览文件 @
b4578506
...
...
@@ -39,7 +39,6 @@ YOLOv3Head:
drop_block
:
true
YOLOv3Loss
:
batch_size
:
32
ignore_thresh
:
0.7
scale_x_y
:
1.05
label_smooth
:
false
...
...
configs/ppyolo/ppyolo_test.yml
浏览文件 @
b4578506
...
...
@@ -47,7 +47,6 @@ YOLOv3Head:
drop_block
:
true
YOLOv3Loss
:
batch_size
:
24
ignore_thresh
:
0.7
scale_x_y
:
1.05
label_smooth
:
false
...
...
configs/yolov3_darknet.yml
浏览文件 @
b4578506
...
...
@@ -35,11 +35,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
true
...
...
configs/yolov3_darknet_voc.yml
浏览文件 @
b4578506
...
...
@@ -36,11 +36,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
...
...
configs/yolov3_darknet_voc_diouloss.yml
浏览文件 @
b4578506
...
...
@@ -36,7 +36,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
iou_loss
:
DiouLossYolo
...
...
configs/yolov3_mobilenet_v1.yml
浏览文件 @
b4578506
...
...
@@ -36,11 +36,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
true
...
...
configs/yolov3_mobilenet_v1_fruit.yml
浏览文件 @
b4578506
...
...
@@ -38,11 +38,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
true
...
...
configs/yolov3_mobilenet_v1_voc.yml
浏览文件 @
b4578506
...
...
@@ -37,11 +37,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
...
...
configs/yolov3_mobilenet_v3.yml
浏览文件 @
b4578506
...
...
@@ -38,11 +38,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
...
...
configs/yolov3_r34.yml
浏览文件 @
b4578506
...
...
@@ -38,11 +38,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
true
...
...
configs/yolov3_r34_voc.yml
浏览文件 @
b4578506
...
...
@@ -39,11 +39,6 @@ YOLOv3Head:
score_threshold
:
0.01
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
false
...
...
configs/yolov4/yolov4_cspdarknet.yml
浏览文件 @
b4578506
...
...
@@ -35,11 +35,6 @@ YOLOv4Head:
scale_x_y
:
[
1.2
,
1.1
,
1.05
]
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
4
ignore_thresh
:
0.7
label_smooth
:
true
downsample
:
[
8
,
16
,
32
]
...
...
configs/yolov4/yolov4_cspdarknet_coco.yml
浏览文件 @
b4578506
...
...
@@ -34,11 +34,6 @@ YOLOv4Head:
scale_x_y
:
[
1.2
,
1.1
,
1.05
]
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
8
ignore_thresh
:
0.7
label_smooth
:
true
downsample
:
[
8
,
16
,
32
]
...
...
configs/yolov4/yolov4_cspdarknet_voc.yml
浏览文件 @
b4578506
...
...
@@ -34,11 +34,6 @@ YOLOv4Head:
scale_x_y
:
[
1.2
,
1.1
,
1.05
]
YOLOv3Loss
:
# batch_size here is only used for fine grained loss, not used
# for training batch_size setting, training batch_size setting
# is in configs/yolov3_reader.yml TrainReader.batch_size, batch
# size here should be set as same value as TrainReader.batch_size
batch_size
:
4
ignore_thresh
:
0.7
label_smooth
:
true
downsample
:
[
8
,
16
,
32
]
...
...
ppdet/core/workspace.py
浏览文件 @
b4578506
...
...
@@ -97,6 +97,15 @@ def load_config(file_path):
del
cfg
[
READER_KEY
]
merge_config
(
cfg
)
# NOTE: training batch size defined only in TrainReader, sychornized
# batch size config to global, models can get batch size config
# from global config when building model.
# batch size in evaluation or inference can also be added here
if
'TrainReader'
in
global_config
:
global_config
[
'train_batch_size'
]
=
global_config
[
'TrainReader'
][
'batch_size'
]
return
global_config
...
...
ppdet/modeling/losses/yolo_loss.py
浏览文件 @
b4578506
...
...
@@ -32,17 +32,17 @@ class YOLOv3Loss(object):
Combined loss for YOLOv3 network
Args:
batch_size (int): training batch size
train_
batch_size (int): training batch size
ignore_thresh (float): threshold to ignore confidence loss
label_smooth (bool): whether to use label smoothing
use_fine_grained_loss (bool): whether use fine grained YOLOv3 loss
instead of fluid.layers.yolov3_loss
"""
__inject__
=
[
'iou_loss'
,
'iou_aware_loss'
]
__shared__
=
[
'use_fine_grained_loss'
]
__shared__
=
[
'use_fine_grained_loss'
,
'train_batch_size'
]
def
__init__
(
self
,
batch_size
=
8
,
train_
batch_size
=
8
,
ignore_thresh
=
0.7
,
label_smooth
=
True
,
use_fine_grained_loss
=
False
,
...
...
@@ -51,7 +51,7 @@ class YOLOv3Loss(object):
downsample
=
[
32
,
16
,
8
],
scale_x_y
=
1.
,
match_score
=
False
):
self
.
_
batch_size
=
batch_size
self
.
_
train_batch_size
=
train_
batch_size
self
.
_ignore_thresh
=
ignore_thresh
self
.
_label_smooth
=
label_smooth
self
.
_use_fine_grained_loss
=
use_fine_grained_loss
...
...
@@ -65,7 +65,7 @@ class YOLOv3Loss(object):
anchor_masks
,
mask_anchors
,
num_classes
,
prefix_name
):
if
self
.
_use_fine_grained_loss
:
return
self
.
_get_fine_grained_loss
(
outputs
,
targets
,
gt_box
,
self
.
_batch_size
,
num_classes
,
outputs
,
targets
,
gt_box
,
self
.
_
train_
batch_size
,
num_classes
,
mask_anchors
,
self
.
_ignore_thresh
)
else
:
losses
=
[]
...
...
@@ -95,7 +95,7 @@ class YOLOv3Loss(object):
outputs
,
targets
,
gt_box
,
batch_size
,
train_
batch_size
,
num_classes
,
mask_anchors
,
ignore_thresh
,
...
...
@@ -108,7 +108,7 @@ class YOLOv3Loss(object):
targets ([Variables]): List of Variables, The targets for yolo
loss calculatation.
gt_box (Variable): The ground-truth boudding boxes.
batch_size (int): The training batch size
train_
batch_size (int): The training batch size
num_classes (int): class num of dataset
mask_anchors ([[float]]): list of anchors in each output layer
ignore_thresh (float): prediction bbox overlap any gt_box greater
...
...
@@ -171,7 +171,7 @@ class YOLOv3Loss(object):
loss_h
=
fluid
.
layers
.
reduce_sum
(
loss_h
,
dim
=
[
1
,
2
,
3
])
if
self
.
_iou_loss
is
not
None
:
loss_iou
=
self
.
_iou_loss
(
x
,
y
,
w
,
h
,
tx
,
ty
,
tw
,
th
,
anchors
,
downsample
,
self
.
_batch_size
,
downsample
,
self
.
_
train_
batch_size
,
scale_x_y
)
loss_iou
=
loss_iou
*
tscale_tobj
loss_iou
=
fluid
.
layers
.
reduce_sum
(
loss_iou
,
dim
=
[
1
,
2
,
3
])
...
...
@@ -180,14 +180,14 @@ class YOLOv3Loss(object):
if
self
.
_iou_aware_loss
is
not
None
:
loss_iou_aware
=
self
.
_iou_aware_loss
(
ioup
,
x
,
y
,
w
,
h
,
tx
,
ty
,
tw
,
th
,
anchors
,
downsample
,
self
.
_batch_size
,
scale_x_y
)
self
.
_
train_
batch_size
,
scale_x_y
)
loss_iou_aware
=
loss_iou_aware
*
tobj
loss_iou_aware
=
fluid
.
layers
.
reduce_sum
(
loss_iou_aware
,
dim
=
[
1
,
2
,
3
])
loss_iou_awares
.
append
(
fluid
.
layers
.
reduce_mean
(
loss_iou_aware
))
loss_obj_pos
,
loss_obj_neg
=
self
.
_calc_obj_loss
(
output
,
obj
,
tobj
,
gt_box
,
self
.
_batch_size
,
anchors
,
output
,
obj
,
tobj
,
gt_box
,
self
.
_
train_
batch_size
,
anchors
,
num_classes
,
downsample
,
self
.
_ignore_thresh
,
scale_x_y
)
loss_cls
=
fluid
.
layers
.
sigmoid_cross_entropy_with_logits
(
cls
,
tcls
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录