microsoft / SoftTeacher

Semi-Supervised Learning, Object Detection, ICCV2021
MIT License
904 stars 123 forks source link

is dataset have transform_matrix?unsup_loss_bbox: 0.0000 when i try to train, I wanted to know if it was because of the data set, but my data set was fully trained and calculated on the supervised model? #206

Open joeyslv opened 2 years ago

joeyslv commented 2 years ago

Can you tell me what that transform_matrix means ?Does this label have to be in the dataset? Because I'm using browse_dataset.pyand I can't get my data set through.


(arknights) E:\Object-Detection\SoftTeacher>python tools\misc\browse_dataset.py configs\soft_teacher\soft_teacher_faster_rcnn_r50_caffe_fpn_coco_180k.py --skip-type Normalize
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
loading annotations into memory...
Done (t=0.10s)
creating index...
index created!
[                                                  ] 0/4000, elapsed: 0s, ETA:Traceback (most recent call last):
  File "tools\misc\browse_dataset.py", line 173, in <module>
    main()
  File "tools\misc\browse_dataset.py", line 107, in main
    trans_matrix = it["transform_matrix"]
KeyError: 'transform_matrix'
joeyslv commented 2 years ago

And when I was slicing through data in the coco format, was licenses label missing from my data, was it necessary?

(arknights) E:\Object-Detection\SoftTeacher>python tools/dataset/semi_coco.py --percent 2 --seed 1 --data-dir data/coco
Namespace(data_dir='data/coco', percent=2.0, seed=1, seed_offset=0, version=2017)
>> Processing dataset instances_train2017.1@2.json saved (80 images 249 annotations)
Traceback (most recent call last):
  File "tools/dataset/semi_coco.py", line 130, in <module>
    prepare_coco_data(args.seed, args.percent, args.version, args.seed_offset)
  File "tools/dataset/semi_coco.py", line 103, in prepare_coco_data
    _save_anno(save_name, labeled_images, labeled_annotations)
  File "tools/dataset/semi_coco.py", line 46, in _save_anno
    new_anno["licenses"] = anno["licenses"]
KeyError: 'licenses'
joeyslv commented 2 years ago

i set the licenses and info = [] it can split my dataset but unsup_loss_rpn_cls andunsup_loss_rpn_bbox ==0 ,Can someone please tell me how to fix this?

        new_anno = {}
        new_anno["images"] = images
        new_anno["annotations"] = annotations
        # new_anno["licenses"] = anno["licenses"]
        new_anno["licenses"] = []
        new_anno["categories"] = anno["categories"]
        # new_anno["info"] = anno["info"]
        new_anno["info"] = []
2022-04-28 12:47:54,984 - mmdet.ssod - INFO - Iter [920/180000] lr: 1.000e-02, eta: 1 day, 5:19:15, time: 0.186, data_time: 0.011, memory: 1348, ema_momentum: 0.9989, unsup_loss_rpn_cls: 0.0000, unsup_loss_rpn_bbox: 0.0000, unsup_loss_cls: nan, unsup_acc: 100.0000, unsup_loss_bbox: 0.0000, loss: nan, sup_loss_rpn_cls: 1076.7111, sup_loss_rpn_bbox: 5227.1304, sup_loss_cls: nan, sup_acc: 96.7661, sup_loss_bbox: 527.9321
2022-04-28 12:47:57,024 - mmdet.ssod - INFO - Iter [930/180000] lr: 1.000e-02, eta: 1 day, 5:06:48, time: 0.204, data_time: 0.010, memory: 1348, ema_momentum: 0.9989, unsup_loss_rpn_cls: 0.0000, unsup_loss_rpn_bbox: 0.0000, unsup_loss_cls: nan, unsup_acc: 100.0000, unsup_loss_bbox: 0.0000, loss: nan, sup_loss_rpn_cls: 1180.6719, sup_loss_rpn_bbox: 5426.3616, sup_loss_cls: nan, sup_acc: 96.5506, sup_loss_bbox: 539.1928
2022-04-28 12:47:59,037 - mmdet.ssod - INFO - Iter [940/180000] lr: 1.000e-02, eta: 1 day, 4:54:30, time: 0.201, data_time: 0.011, memory: 1348, ema_momentum: 0.9989, unsup_loss_rpn_cls: 0.0000, unsup_loss_rpn_bbox: 0.0000, unsup_loss_cls: nan, unsup_acc: 100.0000, unsup_loss_bbox: 0.0000, loss: nan, sup_loss_rpn_cls: 937.6067, sup_loss_rpn_bbox: 4569.9730, sup_loss_cls: nan, sup_acc: 97.1894, sup_loss_bbox: 429.4947
xiangtaowong commented 2 years ago

Hello, how did u solve the qusetion "unsup_loss_bbox: 0.0000"?

joeyslv commented 2 years ago

Hello, how did u solve the qusetion "unsup_loss_bbox: 0.0000"?

没有,他们说是数据集的问题,但是我仔细检查了还是不行,放弃了

xiangtaowong commented 2 years ago

Hello, how did u solve the qusetion "unsup_loss_bbox: 0.0000"?

没有,他们说是数据集的问题,但是我仔细检查了还是不行,放弃了

好的,谢谢您

joeyslv commented 2 years ago

Hello, how did u solve the qusetion "unsup_loss_bbox: 0.0000"?

没有,他们说是数据集的问题,但是我仔细检查了还是不行,放弃了

好的,谢谢您

我最近在linux上重新装了一下环境跑通了 发现不是我的数据有问题 非监督的损失"unsup_loss_bbox: 0.0000"需要训练等更新了教师参数才有 你可以把伪标签阈值设定得低一些 代码里初始是0.9

xiangtaowong commented 2 years ago

好的,非常感谢