facebookresearch / adaptive_teacher

This repo provides the source code for "Cross-Domain Adaptive Teacher for Object Detection".
Other
180 stars 35 forks source link

some puzzles about using "branch.startswith("supervised")" in adapteacher/modeling/meta_arch/rcnn.py #32

Closed gedebachichi closed 1 year ago

gedebachichi commented 2 years ago

Hi,I find you write "if branch.startswith("supervised")" in line 217 of adapteacher/modeling/meta_arch/rcnn.py. I am confused of it. I think it might be some problem when we run loss of unlabeled data with pseudo label ( in line 605 of adapteacher/engine/trainer.py), which should run in branch "supervised_target". And I think this will result wrong label for loss_D_img_s_pesudo. Please check it.

yujheli commented 2 years ago

There is no loss_D_img_s_pesudo in supervised_target for unlabelled data. The code should be fine.

gedebachichi commented 2 years ago

thank you for your reply. If you run unlabeled data in branch "supervised_target", there is no loss_D_img. But you will run in branch "supervised" because "supervised_target" is startswith "supervised", and then get loss_D_img_s (gt_label is wrong because you fix domain label as source domain in branch "supervised" while real label for unlabeled data is target domain). Then you update loss_D_img_s to loss_D_img_s_pesudo in line 610 of adapteacher/engine/trainer.py. So there exists loss_D_img_s_pesudo of unlabeled data.

yujheli commented 1 year ago

@gedebachichi You are right. I need to revise the if-else branch. Thank you for noting this!