PeizeSun / SparseR-CNN

[CVPR2021, PAMI2023] End-to-End Object Detection with Learnable Proposal
MIT License
1.31k stars 187 forks source link

When set num_heads = 1, doesnt train #68

Open abeyang00 opened 3 years ago

abeyang00 commented 3 years ago

First of all, thank you for the wonderful work. I have a quick question though.

I see you have set num_head = 6, meaning you iteratively update bounding box results 6 times before getting final output.

I wanted to see if i can just use 1 iteration so i set cfg.model.sparsercnn.num_heads = 1

But training does not go well and i get following result

Screenshot from 2021-02-22 10-59-26

AP only goes upto 3%...

Any suggestion to what i'm doing wrong? should i also set cfg.model.sparsercnn.deep_supervision = false? even though this is same as setting num_heads = 1?

Thank you!

PeizeSun commented 3 years ago

Hi~ Do you change any other codes?

abeyang00 commented 3 years ago

@PeizeSun no i didnt change anything else. when i set num_heads=6, it trains well.

Its only when i set num_heads=1, it doesnt train well

PeizeSun commented 3 years ago

when you set num_heads=6, is the final performance the same as our reported performance?

abeyang00 commented 3 years ago

In the paper AP is 42.3 but i reproduced 38%. Not the same but close enough.

PeizeSun commented 3 years ago

Do you train on 8GPUs?

abeyang00 commented 3 years ago

No, just 1 gpu.

PeizeSun commented 3 years ago

I guess only 1 gpu is the reason for 1 head not working.
The first head of proposal box and features is not dependent on input image, later heads are dependent. So only one head needs large batch size to provide statistic information. Usually training is on 8 gpus and batch size 16. If training on 1 gpu, small batch size can't provide effective statistic information.

abeyang00 commented 3 years ago

so if i only have 1 gpu and using 1 iteration head, i can't train the network??

PeizeSun commented 3 years ago

Maybe reducing learning rate could help.

abeyang00 commented 3 years ago

thank you, i'll try it.

QinghangHong1 commented 3 years ago

First of all, thank you for the wonderful work. I have a quick question though.

I see you have set num_head = 6, meaning you iteratively update bounding box results 6 times before getting final output.

I wanted to see if i can just use 1 iteration so i set cfg.model.sparsercnn.num_heads = 1

But training does not go well and i get following result

Screenshot from 2021-02-22 10-59-26

AP only goes upto 3%...

Any suggestion to what i'm doing wrong? should i also set cfg.model.sparsercnn.deep_supervision = false? even though this is same as setting num_heads = 1?

Thank you!

Hi,

Your plots look really nice and clean. Could you share how you plot the mAP trend from the log, please? Thank you a lot!

ZhuYuChenNO1 commented 11 months ago

detectron2 will generate tensorboard itself in your output floder, just use it...