microsoft / SoftTeacher

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

Training discrepancy on custom data #170

Open Mansoor-at opened 2 years ago

Mansoor-at commented 2 years ago

When I run the code on coco, I get following statistics during training

2022-02-24 10:17:56,029 - mmdet.ssod - INFO - Iter [112050/180000] lr: 1.000e-02, eta: 81 days, 16:16:19, time: 100.132, data_time: 98.562, memory: 7480, ema_momentum: 0.9990, sup_loss_rpn_cls: 0.0827, sup_loss_rpn_bbox: 0.0696, sup_loss_cls: 0.3059, sup_acc: 91.7238, sup_loss_bbox: 0.2549, unsup_loss_rpn_cls: 0.0817, unsup_loss_rpn_bbox: 0.0868, unsup_loss_cls: 0.4136, unsup_acc: 96.2484, unsup_loss_bbox: 0.3910, loss: 1.6862

But when I run on my own dataset, I dont get supervised stats, i just get unsupervised, and accuracy 100%, can you please explain.

2022-02-24 10:41:18,992 - mmdet.ssod - INFO - Iter [800/2000] lr: 1.000e-02, eta: 0:12:37, time: 0.633, data_time: 0.018, memory: 2491, ema_momentum: 0.9988, unsup_loss_rpn_cls: 0.0000, unsup_loss_rpn_bbox: 0.0000, unsup_loss_cls: 0.0000, unsup_acc: 100.0000, unsup_loss_bbox: 0.0000, loss: 0.0000

wjm202 commented 2 years ago

I also have this question why?

oceanogeology commented 2 years ago

got the same question before, solved by adding 'classes' in data configs like:

data = dict( samples_per_gpu=4, workers_per_gpu=8, train=dict( sup=dict( type=dataset_type, classes=classes, ann_file=data_root_sup+'json_coco.json', img_prefix=data_root_sup+'img', ), unsup=dict( type=dataset_type, classes=classes, ann_file=data_root_unsup+'json_coco_unsup.json', img_prefix=data_root_unsup+'img', ), ), )

wjm202 commented 2 years ago

got the same question before, solved by adding 'classes' in data configs like:

data = dict( samples_per_gpu=4, workers_per_gpu=8, train=dict( sup=dict( type=dataset_type, classes=classes, ann_file=data_root_sup+'json_coco.json', img_prefix=data_root_sup+'img', ), unsup=dict( type=dataset_type, classes=classes, ann_file=data_root_unsup+'json_coco_unsup.json', img_prefix=data_root_unsup+'img', ), ), ) II tried your method and it didn't work. During code debugging, I found that the reason for this problem is that the unsupervised data is not imported into the model, but I don't know how to solve it

wjm202 commented 2 years ago

即使我加入了自己的预训练模型(load_from)teacher模型也根本没有训练,也就是说unlabelled数据根本没有传进来