未验证 提交 d6ffa2b5 编写于 作者: S shangliang Xu 提交者: GitHub

[PPYOLOE] fix oom eval in train (#5409)

上级 0fe525af
epoch: 300 epoch: 300
LearningRate: LearningRate:
base_lr: 0.03 base_lr: 0.025
schedulers: schedulers:
- !CosineDecay - !CosineDecay
max_epochs: 360 max_epochs: 360
- !LinearWarmup - !LinearWarmup
start_factor: 0.001 start_factor: 0.
steps: 3000 epochs: 5
OptimizerBuilder: OptimizerBuilder:
optimizer: optimizer:
......
worker_num: 8 worker_num: 4
TrainReader: TrainReader:
sample_transforms: sample_transforms:
- Decode: {} - Decode: {}
...@@ -11,7 +11,7 @@ TrainReader: ...@@ -11,7 +11,7 @@ TrainReader:
- NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True} - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
- Permute: {} - Permute: {}
- PadGT: {} - PadGT: {}
batch_size: 24 batch_size: 20
shuffle: true shuffle: true
drop_last: true drop_last: true
use_shared_memory: true use_shared_memory: true
...@@ -23,7 +23,7 @@ EvalReader: ...@@ -23,7 +23,7 @@ EvalReader:
- Resize: {target_size: [640, 640], keep_ratio: False, interp: 2} - Resize: {target_size: [640, 640], keep_ratio: False, interp: 2}
- NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True} - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
- Permute: {} - Permute: {}
batch_size: 4 batch_size: 2
TestReader: TestReader:
inputs_def: inputs_def:
......
...@@ -9,7 +9,6 @@ _BASE_: [ ...@@ -9,7 +9,6 @@ _BASE_: [
log_iter: 100 log_iter: 100
snapshot_epoch: 10 snapshot_epoch: 10
weights: output/ppyoloe_crn_l_300e_coco/model_final weights: output/ppyoloe_crn_l_300e_coco/model_final
find_unused_parameters: True
pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_l_pretrained.pdparams pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_l_pretrained.pdparams
depth_mult: 1.0 depth_mult: 1.0
......
...@@ -9,20 +9,13 @@ _BASE_: [ ...@@ -9,20 +9,13 @@ _BASE_: [
log_iter: 100 log_iter: 100
snapshot_epoch: 10 snapshot_epoch: 10
weights: output/ppyoloe_crn_m_300e_coco/model_final weights: output/ppyoloe_crn_m_300e_coco/model_final
find_unused_parameters: True
pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_m_pretrained.pdparams pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_m_pretrained.pdparams
depth_mult: 0.67 depth_mult: 0.67
width_mult: 0.75 width_mult: 0.75
TrainReader: TrainReader:
batch_size: 32 batch_size: 28
LearningRate: LearningRate:
base_lr: 0.04 base_lr: 0.035
schedulers:
- !CosineDecay
max_epochs: 360
- !LinearWarmup
start_factor: 0.001
steps: 2300
...@@ -9,7 +9,6 @@ _BASE_: [ ...@@ -9,7 +9,6 @@ _BASE_: [
log_iter: 100 log_iter: 100
snapshot_epoch: 10 snapshot_epoch: 10
weights: output/ppyoloe_crn_s_300e_coco/model_final weights: output/ppyoloe_crn_s_300e_coco/model_final
find_unused_parameters: True
pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_s_pretrained.pdparams pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_s_pretrained.pdparams
depth_mult: 0.33 depth_mult: 0.33
...@@ -20,9 +19,3 @@ TrainReader: ...@@ -20,9 +19,3 @@ TrainReader:
LearningRate: LearningRate:
base_lr: 0.04 base_lr: 0.04
schedulers:
- !CosineDecay
max_epochs: 360
- !LinearWarmup
start_factor: 0.001
steps: 2300
...@@ -9,7 +9,6 @@ _BASE_: [ ...@@ -9,7 +9,6 @@ _BASE_: [
log_iter: 100 log_iter: 100
snapshot_epoch: 10 snapshot_epoch: 10
weights: output/ppyoloe_crn_x_300e_coco/model_final weights: output/ppyoloe_crn_x_300e_coco/model_final
find_unused_parameters: True
pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_x_pretrained.pdparams pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_x_pretrained.pdparams
depth_mult: 1.33 depth_mult: 1.33
...@@ -20,9 +19,3 @@ TrainReader: ...@@ -20,9 +19,3 @@ TrainReader:
LearningRate: LearningRate:
base_lr: 0.02 base_lr: 0.02
schedulers:
- !CosineDecay
max_epochs: 360
- !LinearWarmup
start_factor: 0.001
steps: 4600
...@@ -183,9 +183,6 @@ class ATSSAssigner(nn.Layer): ...@@ -183,9 +183,6 @@ class ATSSAssigner(nn.Layer):
mask_positive) mask_positive)
mask_positive_sum = mask_positive.sum(axis=-2) mask_positive_sum = mask_positive.sum(axis=-2)
assigned_gt_index = mask_positive.argmax(axis=-2) assigned_gt_index = mask_positive.argmax(axis=-2)
assert mask_positive_sum.max() == 1, \
("one anchor just assign one gt, but received not equals 1. "
"Received: %f" % mask_positive_sum.max().item())
# assigned target # assigned target
batch_ind = paddle.arange( batch_ind = paddle.arange(
......
...@@ -129,9 +129,6 @@ class TaskAlignedAssigner(nn.Layer): ...@@ -129,9 +129,6 @@ class TaskAlignedAssigner(nn.Layer):
mask_positive) mask_positive)
mask_positive_sum = mask_positive.sum(axis=-2) mask_positive_sum = mask_positive.sum(axis=-2)
assigned_gt_index = mask_positive.argmax(axis=-2) assigned_gt_index = mask_positive.argmax(axis=-2)
assert mask_positive_sum.max() == 1, \
("one anchor just assign one gt, but received not equals 1. "
"Received: %f" % mask_positive_sum.max().item())
# assigned target # assigned target
assigned_gt_index = assigned_gt_index + batch_ind * num_max_boxes assigned_gt_index = assigned_gt_index + batch_ind * num_max_boxes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册