Unverified Commit bd1525ec authored by ChaimZhu's avatar ChaimZhu Committed by GitHub
Browse files

[Fix] fix fcos3d and pgd configs (#2191)

* fix configs

* change auto_scale_lr
parent 952a5923
...@@ -4,5 +4,5 @@ model = dict( ...@@ -4,5 +4,5 @@ model = dict(
train_cfg=dict( train_cfg=dict(
code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.05, 0.05])) code_weight=[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.05, 0.05]))
# optimizer # optimizer
optimizer = dict(lr=0.001) optim_wrapper = dict(optimizer=dict(lr=0.001))
load_from = 'work_dirs/fcos3d_nus/latest.pth' load_from = 'work_dirs/fcos3d_nus/latest.pth'
...@@ -4,6 +4,12 @@ _base_ = [ ...@@ -4,6 +4,12 @@ _base_ = [
] ]
# model settings # model settings
model = dict( model = dict(
data_preprocessor=dict(
type='Det3DDataPreprocessor',
mean=[103.530, 116.280, 123.675],
std=[1.0, 1.0, 1.0],
bgr_to_rgb=False,
pad_size_divisor=32),
backbone=dict( backbone=dict(
dcn=dict(type='DCNv2', deform_groups=1, fallback_on_stride=False), dcn=dict(type='DCNv2', deform_groups=1, fallback_on_stride=False),
stage_with_dcn=(False, False, True, True)), stage_with_dcn=(False, False, True, True)),
...@@ -40,10 +46,6 @@ model = dict( ...@@ -40,10 +46,6 @@ model = dict(
]), ]),
test_cfg=dict(nms_pre=1000, nms_thr=0.8, score_thr=0.01, max_per_img=200)) test_cfg=dict(nms_pre=1000, nms_thr=0.8, score_thr=0.01, max_per_img=200))
class_names = [
'car', 'truck', 'trailer', 'bus', 'construction_vehicle', 'bicycle',
'motorcycle', 'pedestrian', 'traffic_cone', 'barrier'
]
train_pipeline = [ train_pipeline = [
dict(type='LoadImageFromFileMono3D'), dict(type='LoadImageFromFileMono3D'),
dict( dict(
...@@ -54,7 +56,7 @@ train_pipeline = [ ...@@ -54,7 +56,7 @@ train_pipeline = [
with_bbox_3d=True, with_bbox_3d=True,
with_label_3d=True, with_label_3d=True,
with_bbox_depth=True), with_bbox_depth=True),
dict(type='Resize', img_scale=(1600, 900), keep_ratio=True), dict(type='mmdet.Resize', scale=(1600, 900), keep_ratio=True),
dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5), dict(type='RandomFlip3D', flip_ratio_bev_horizontal=0.5),
dict( dict(
type='Pack3DDetInputs', type='Pack3DDetInputs',
...@@ -65,33 +67,36 @@ train_pipeline = [ ...@@ -65,33 +67,36 @@ train_pipeline = [
] ]
test_pipeline = [ test_pipeline = [
dict(type='LoadImageFromFileMono3D'), dict(type='LoadImageFromFileMono3D'),
dict( dict(type='mmdet.Resize', scale_factor=1.0),
type='MultiScaleFlipAug',
scale_factor=1.0,
flip=False,
transforms=[
dict(type='RandomFlip3D'),
]),
dict(type='Pack3DDetInputs', keys=['img']), dict(type='Pack3DDetInputs', keys=['img']),
] ]
data = dict( train_dataloader = dict(
samples_per_gpu=2, batch_size=2, num_workers=2, dataset=dict(pipeline=train_pipeline))
workers_per_gpu=2, test_dataloader = dict(dataset=dict(pipeline=test_pipeline))
train=dict(pipeline=train_pipeline), val_dataloader = dict(dataset=dict(pipeline=test_pipeline))
val=dict(pipeline=test_pipeline),
test=dict(pipeline=test_pipeline))
# optimizer # optimizer
optimizer = dict( optim_wrapper = dict(
lr=0.004, paramwise_cfg=dict(bias_lr_mult=2., bias_decay_mult=0.)) optimizer=dict(lr=0.004),
optimizer_config = dict( paramwise_cfg=dict(bias_lr_mult=2., bias_decay_mult=0.),
_delete_=True, grad_clip=dict(max_norm=35, norm_type=2)) clip_grad=dict(max_norm=35, norm_type=2))
# learning policy # learning policy
lr_config = dict( param_scheduler = [
policy='step', dict(
warmup='linear', type='LinearLR',
warmup_iters=500, start_factor=1.0 / 3,
warmup_ratio=1.0 / 3, by_epoch=False,
step=[8, 11]) begin=0,
total_epochs = 12 end=500),
evaluation = dict(interval=4) dict(
runner = dict(max_epochs=total_epochs) type='MultiStepLR',
begin=0,
end=12,
by_epoch=True,
milestones=[8, 11],
gamma=0.1)
]
train_cfg = dict(max_epochs=12, val_interval=4)
auto_scale_lr = dict(base_batch_size=32)
...@@ -5,5 +5,5 @@ model = dict( ...@@ -5,5 +5,5 @@ model = dict(
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.05, 0.05, 0.2, 0.2, 0.2, 0.2 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.05, 0.05, 0.2, 0.2, 0.2, 0.2
])) ]))
# optimizer # optimizer
optimizer = dict(lr=0.002) optim_wrapper = dict(optimizer=dict(lr=0.002))
load_from = 'work_dirs/pgd_nus_benchmark_1x/latest.pth' load_from = 'work_dirs/pgd_nus_benchmark_1x/latest.pth'
_base_ = './pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py' _base_ = './pgd_r101-caffe_fpn_head-gn_16xb2-1x_nus-mono3d.py'
# learning policy # learning policy
lr_config = dict(step=[16, 22]) param_scheduler = [
total_epochs = 24 dict(
runner = dict(max_epochs=total_epochs) type='LinearLR',
start_factor=1.0 / 3,
by_epoch=False,
begin=0,
end=500),
dict(
type='MultiStepLR',
begin=0,
end=24,
by_epoch=True,
milestones=[16, 22],
gamma=0.1)
]
train_cfg = dict(max_epochs=24)
...@@ -5,5 +5,5 @@ model = dict( ...@@ -5,5 +5,5 @@ model = dict(
1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.05, 0.05, 0.2, 0.2, 0.2, 0.2 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.05, 0.05, 0.2, 0.2, 0.2, 0.2
])) ]))
# optimizer # optimizer
optimizer = dict(lr=0.002) optim_wrapper = dict(optimizer=dict(lr=0.002))
load_from = 'work_dirs/pgd_nus_benchmark_2x/latest.pth' load_from = 'work_dirs/pgd_nus_benchmark_2x/latest.pth'
...@@ -68,18 +68,18 @@ model = dict( ...@@ -68,18 +68,18 @@ model = dict(
]), ]),
test_cfg=dict(nms_pre=100, nms_thr=0.05, score_thr=0.001, max_per_img=20)) test_cfg=dict(nms_pre=100, nms_thr=0.05, score_thr=0.001, max_per_img=20))
# file_client_args = dict(backend='disk') file_client_args = dict(backend='disk')
# Uncomment the following if use ceph or other file clients. # Uncomment the following if use ceph or other file clients.
# See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient # See https://mmcv.readthedocs.io/en/latest/api.html#mmcv.fileio.FileClient
# for more details. # for more details.
file_client_args = dict( # file_client_args = dict(
backend='petrel', # backend='petrel',
path_mapping=dict({ # path_mapping=dict({
'./data/kitti/': # './data/kitti/':
's3://openmmlab/datasets/detection3d/kitti/', # 's3://openmmlab/datasets/detection3d/kitti/',
'data/kitti/': # 'data/kitti/':
's3://openmmlab/datasets/detection3d/kitti/' # 's3://openmmlab/datasets/detection3d/kitti/'
})) # }))
train_pipeline = [ train_pipeline = [
dict(type='LoadImageFromFileMono3D'), dict(type='LoadImageFromFileMono3D'),
...@@ -135,3 +135,4 @@ param_scheduler = [ ...@@ -135,3 +135,4 @@ param_scheduler = [
] ]
train_cfg = dict(max_epochs=48, val_interval=2) train_cfg = dict(max_epochs=48, val_interval=2)
auto_scale_lr = dict(base_batch_size=12)
...@@ -105,8 +105,8 @@ param_scheduler = [ ...@@ -105,8 +105,8 @@ param_scheduler = [
milestones=[16, 22], milestones=[16, 22],
gamma=0.1) gamma=0.1)
] ]
total_epochs = 24
runner = dict(max_epochs=total_epochs)
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=24, val_interval=24) train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=24, val_interval=24)
val_cfg = dict(type='ValLoop') val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop') test_cfg = dict(type='TestLoop')
auto_scale_lr = dict(base_batch_size=48)
...@@ -104,8 +104,8 @@ param_scheduler = [ ...@@ -104,8 +104,8 @@ param_scheduler = [
milestones=[16, 22], milestones=[16, 22],
gamma=0.1) gamma=0.1)
] ]
total_epochs = 24
runner = dict(max_epochs=total_epochs)
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=24, val_interval=24) train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=24, val_interval=24)
val_cfg = dict(type='ValLoop') val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop') test_cfg = dict(type='TestLoop')
auto_scale_lr = dict(base_batch_size=48)
...@@ -105,8 +105,8 @@ param_scheduler = [ ...@@ -105,8 +105,8 @@ param_scheduler = [
milestones=[16, 22], milestones=[16, 22],
gamma=0.1) gamma=0.1)
] ]
total_epochs = 24
runner = dict(max_epochs=total_epochs)
train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=24, val_interval=24) train_cfg = dict(type='EpochBasedTrainLoop', max_epochs=24, val_interval=24)
val_cfg = dict(type='ValLoop') val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop') test_cfg = dict(type='TestLoop')
auto_scale_lr = dict(base_batch_size=48)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment