SoftTeacher icon indicating copy to clipboard operation
SoftTeacher copied to clipboard

why unsup_loss is 0.000

Open yangzhaojason opened this issue 3 years ago • 15 comments

image

yangzhaojason avatar Nov 24 '21 07:11 yangzhaojason

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

MendelXu avatar Nov 24 '21 07:11 MendelXu

box About how many iterations will there be greater than 0

yangzhaojason avatar Nov 24 '21 09:11 yangzhaojason

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

yangzhaojason avatar Nov 24 '21 09:11 yangzhaojason

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.

MendelXu avatar Nov 24 '21 09:11 MendelXu

谢谢,我尝试一下

yangzhaojason avatar Nov 24 '21 12:11 yangzhaojason

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

plalexx avatar Dec 02 '21 15:12 plalexx

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

MendelXu avatar Dec 03 '21 08:12 MendelXu

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).

JLC7 avatar Jan 06 '22 17:01 JLC7

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?

MendelXu avatar Jan 07 '22 05:01 MendelXu

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)

JLC7 avatar Jan 11 '22 05:01 JLC7

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

MendelXu avatar Jan 11 '22 06:01 MendelXu

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.

wjm202 avatar Mar 05 '22 08:03 wjm202

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?

shen0526 avatar May 30 '22 02:05 shen0526

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 avatar Jun 14 '22 12:06 curiosity654

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.

curiosity654 avatar Jun 18 '22 09:06 curiosity654