Sense-X / Co-DETR

[ICCV 2023] DETRs with Collaborative Hybrid Assignments Training
MIT License
950 stars 100 forks source link

backbone 换swin-L,效果变差 #146

Open Blissy-32 opened 2 months ago

Blissy-32 commented 2 months ago

请问 我在某公开数据集上训练 用resnet50 12轮可以0.415 但是换swin-L后,batch-size设为1,多尺度size等不变,最高0.39,还是扩大学习率之后的,用线性计算学习率才0.34 是为什么呢

TempleX98 commented 2 months ago

batch size为1太小了,就算线性scale学习率也会掉点

Whitefish-by commented 1 month ago

请问 我的显卡是两张L40,训练co_deformable_detr_swin_large_1x_coco.py,设置多少的per_smple_cpu和base_batch_size合适呢? 刚开始训练的时候学习率没改(2e-4),上面的两个参数没改(2,16)。但是,训练完第一个epoch发现评估结果都是0(之前在co_deformable_detr_r50_1x_coco.py上遇到过,改低学习率奏效)。 想请您给个建议,学习率、per_smple_cpu,base_batch_size设置多少比较合适呢?(下面是默认值) auto_scale_lr = dict(enable=False, base_batch_size=16)optimizer = dict( @type='AdamW', lr=2e-4, weight_decay=1e-4, paramwise_cfg=dict( custom_keys={ 'backbone': dict(lr_mult=0.1), 'sampling_offsets': dict(lr_mult=0.1), 'reference_points': dict(lr_mult=0.1) })) @TempleX98 感谢您赐教!

TempleX98 commented 2 weeks ago

不好意思回复得比较晚,可以设置为2张卡,每张卡samples_per_gpu=8,学习率使用2e-4,如果爆显存,samples_per_gpu降到4,学习率变为之前的一半1e-4,以此类推