Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why unsup_loss is 0.000 #117

Open
yangzhaojason opened this issue Nov 24, 2021 · 15 comments
Open

why unsup_loss is 0.000 #117

yangzhaojason opened this issue Nov 24, 2021 · 15 comments

Comments

@yangzhaojason
Copy link

image

@MendelXu
Copy link
Collaborator

It is 0 at the beginning as no pseudo box is generated. However, it should be greater than 0 after several iterations.

@yangzhaojason
Copy link
Author

box
About how many iterations will there be greater than 0

@yangzhaojason
Copy link
Author

另外,我感觉是不是加载一个预训练模型会加速模型的收敛?感觉很多轮依然是0

@MendelXu
Copy link
Collaborator

box
About how many iterations will there be greater than 0

If you are using ms coco, it should increase quickly and be greater than 0 after about 1000~2000 iterations. For other datasets, I am not sure.

另外,我感觉是不是加载一个预训练模型会加速模型的收敛?感觉很多轮依然是0

Yes. adding load_from='{YOUR_MODEL_PATH}' in your config file should be ok.

@yangzhaojason
Copy link
Author

谢谢,我尝试一下

@plalexx
Copy link

plalexx commented Dec 2, 2021

Noticed same problem while training on custom dataset even after large number of iterations. Have you figured what was the issue?

@MendelXu
Copy link
Collaborator

MendelXu commented Dec 3, 2021

Maybe you can try to train a supervised model to see the supervised performance and have an impression of how the predictions look like.

@JLC7
Copy link

JLC7 commented Jan 6, 2022

Same I get 0 unsup_loss bbox even though I used load_from with pretrained model. Sometimes it starts at a small value but eventually goes to zero and during evaluation there are no boxes. I had to set by_probto zero false according to #62 to fix the assert len(indices) == len(self).

@MendelXu
Copy link
Collaborator

MendelXu commented Jan 7, 2022

I am not sure what the problem is. Could you try to train a supervised model and test it on your images to see whether the dataset and model are ready?

@JLC7
Copy link

JLC7 commented Jan 11, 2022

Yes I trained a model using the a config in config/baseline/ and it seems to do well:

 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=1000 ] = 0.938                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=1000 ] = 0.843                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.610                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.683                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.797                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.737                                                                                                                                                                 
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=300 ] = 0.737                                                                                                                                                                 
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=1000 ] = 0.737                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.658                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.732                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.835

When I try with soft teacher it is all zero (i.e. no boxes)

@MendelXu
Copy link
Collaborator

Is it possible for you to upload the log and the config file here?

@wjm202
Copy link

wjm202 commented Mar 5, 2022

Yes I trained a model using the a config in config/baseline/ and it seems to do well:

 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=1000 ] = 0.938                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=1000 ] = 0.843                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.610                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.683                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.797                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.737                                                                                                                                                                 
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=300 ] = 0.737                                                                                                                                                                 
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=1000 ] = 0.737                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.658                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.732                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.835

When I try with soft teacher it is all zero (i.e. no boxes)

do you solve this problem?I've been stuck with the same problem for days.

@shen0526
Copy link

Yes I trained a model using the a config in config/baseline/ and it seems to do well:

 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=1000 ] = 0.938                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=1000 ] = 0.843                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.610                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.683                                                                                                                                                                
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.797                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.737                                                                                                                                                                 
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=300 ] = 0.737                                                                                                                                                                 
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=1000 ] = 0.737                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.658                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.732                                                                                                                                                                
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.835

When I try with soft teacher it is all zero (i.e. no boxes)

do you solve this problem?

@curiosity654
Copy link

I also encountered a similar problem, and I find that the bbox score of the teacher model will soon decrease to below the pseudo label threshold within a few iterations, which is strange.

@curiosity654
Copy link

I also encountered a similar problem, and I find that the bbox score of the teacher model will soon decrease to below the pseudo label threshold within a few iterations, which is strange.

Maybe it's because the threshold is set too high. The loss is zero because there's no pseudo label. For different datasets and models, the pseudo label thresholds are different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants