open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.55k stars 9.46k forks source link

Soft-teacher configuration may have some typo error #10696

Open Ji-Hu opened 1 year ago

Ji-Hu commented 1 year ago

Describe the bug

In the default configuration of the soft-teacher model provided by mmdetection,

model = dict(
    semi_test_cfg=dict(predict_on='teacher'))

I confirmed this configuration makes inference on the teacher model

BUT, the soft-teacher author's configuration defines inference on the student model (and also the paper) author's config line :253

Is the mmdetection's configuration intended or just a typo error?

ryylcc commented 1 year ago

It is because the experimental results show that ‘teacher’ perform better. You can switch to 'student' for inference.

Jeffery-MIC commented 1 year ago

I'm using soft teacher configuration with custom data. However, I found that if I changed the loop to EpochBasedTrainLoop, the training would exceed the displayed iteration number in one epoch like Epoch(train) [1][2150/1458] without stopping to do evaluation. Kindly request for some explanations or help please!

JHT458 commented 1 year ago

I have the same question, type='EpochBasedTrainLoop' and Epoch(train) [1][1000/881] @Jeffery-MIC

Czm369 commented 1 year ago

Only support IterBasedTrainLoop, since there exits two datasets: labeled and unlabled.

JHT458 commented 1 year ago

The problem has been solved according to your method, thank you @Czm369

lzx101 commented 1 year ago

File "e:\lzx\mmdetection\mmdet\models\detectors\soft_teacher.py", line 255, in rcnn_cls_loss_by_pseudo_instances losses['loss_cls'] = losses['loss_cls'] * len( KeyError: 'loss_cls' 你好,我遇到了一个问题,关于损失函数没有loss_cls列表的问题

JHT458 commented 1 year ago

Have you solved the problem? @lzx101

lzx101 commented 1 year ago

Have you solved the problem? @lzx101

解决了,我没有改具体的数据,我只是修改了source_ratio=[1,2]