implus / GFocalV2

Generalized Focal Loss V2: Learning Reliable Localization Quality Estimation for Dense Object Detection, CVPR2021
Apache License 2.0
475 stars 54 forks source link

Quality Focal Loss become infinitive #4

Open black12357 opened 3 years ago

black12357 commented 3 years ago

Thank you for your great work! I have a problem when I tried to run your model on my single computer. The quality focal loss is so big up to value 2000-3000. Do you have any idea to solve this problem? Thank you so much!

liushuai839 commented 3 years ago

Hello, I want to see the source code of GFLv2. But I cannot find it. And this project seems the same as GFLv1, could you tell me where the coresponding code is? Thanks!

implus commented 3 years ago

Thank you for your great work! I have a problem when I tried to run your model on my single computer. The quality focal loss is so big up to value 2000-3000. Do you have any idea to solve this problem? Thank you so much!

We default to use 8 GPUs with a total batch size of 16. If you use smaller batch size in your single computer, I suggest you use smaller learning rate which may help~

black12357 commented 3 years ago

Thank you for your help. I will try to train on multiple GPUs and set suitable learning rate.

black12357 commented 3 years ago

Hello, I want to see the source code of GFLv2. But I cannot find it. And this project seems the same as GFLv1, could you tell me where the coresponding code is? Thanks!

You can get the code here: https://github.com/implus/GFocalV2/blob/master/mmdet/models/dense_heads/gfocal_head.py

implus commented 3 years ago

config的 GFocalHead 里面 loss_cls=dict( type='QualityFocalLoss', use_sigmoid=False, beta=2.0, loss_weight=1.0),

注意use_sigmoid=False

很多对应的代码有一些变化,请注意一下~