Haochen-Wang409 / U2PL

[CVPR'22] Semi-Supervised Semantic Segmentation Using Unreliable Pseudo-Labels
Apache License 2.0
426 stars 59 forks source link

confusions about the accuracy drop of the semi-model in the late training period #114

Closed bailubin closed 1 year ago

bailubin commented 1 year ago

作者您好,我在使用半监督方式在自己的数据集上训练的时候,按照您给的config文件设置了200个epoch,在训练到大约10个epoch的时候模型的表现会达到最好,但是继续训练模型的表现会出现大幅下降,请问这是哪个参数没有设置好吗?我自己的数据集有15个类别,类别分布不太均衡,下面是我的训练参数,使用了两块gpu,感谢您的工作和回复!

{'criterion': {'kwargs': {'min_kept': 100000, 'thresh': 0.7}, 'type': 'ohem'}, 'dataset': {'batch_size': 2, 'ignore_label': 255, 'mean': [123.675, 116.28, 103.53], 'n_sup': 254, 'noise_std': 0.1, 'std': [58.395, 57.12, 57.375], 'train': {'GaussianBlur': False, 'crop': {'size': [256, 256], 'type': 'rand'}, 'data_list': '/home/blb/blbdata/GID/clip/semisup/5/labeled.txt', 'data_root': '/home/blb/blbdata/GID/clip', 'flip': True, 'rand_resize': [0.5, 2.0]}, 'type': 'gid_semi', 'val': {'crop': {'size': [256, 256], 'type': 'center'}, 'data_list': '/home/blb/blbdata/GID/clip/val.txt', 'data_root': '/home/blb/blbdata/GID/clip'}, 'workers': 4}, 'exp_path': '', 'net': {'aux_loss': {'aux_plane': 1024, 'loss_weight': 0.4}, 'decoder': {'kwargs': {'dilations': [12, 24, 36], 'inner_planes': 256}, 'type': 'u2pl.models.decoder.dec_deeplabv3_plus'}, 'ema_decay': 0.99, 'encoder': {'kwargs': {'fpn': True, 'multi_grid': True, 'replace_stride_with_dilation': [False, True, True], 'zero_init_residual': True}, 'type': 'u2pl.models.resnet.resnet101'}, 'num_classes': 15, 'sync_bn': True}, 'save_path': 'checkpoints', 'saver': {'auto_resume': False, 'pretrain': '', 'snapshot_dir': 'checkpoints'}, 'trainer': {'contrastive': {'current_class_negative_threshold': 1, 'current_class_threshold': 0.3, 'high_rank': 20, 'low_entropy_threshold': 20, 'low_rank': 3, 'negative_high_entropy': True, 'num_negatives': 50, 'num_queries': 256, 'temperature': 0.5, 'unsupervised_entropy_ignore': 80}, 'epochs': 100, 'eval_on': True, 'lr_scheduler': {'kwargs': {'power': 0.9}, 'mode': 'poly'}, 'optimizer': {'kwargs': {'lr': 0.001, 'momentum': 0.9, 'weight_decay': 0.0005}, 'type': 'SGD'}, 'sup_only_epoch': 0, 'unsupervised': {'TTA': False, 'apply_aug': 'cutmix', 'drop_percent': 80}}}

Haochen-Wang409 commented 1 year ago

可以提供一下 tensorboard 记录的 loss 信息吗? 另外,数据中有标签数据和无标签数据的比例大约是多少?

bailubin commented 1 year ago

好的,谢谢您,下面是tensorboard记录的loss和iou信息,有标签数据是254张,无标签数据是4842张,比例大概是1:19 image image image image

Haochen-Wang409 commented 1 year ago

您可以先尝试不带 contrastive loss 跑一下,从 tensorboard 上看,unsupervised loss 不是特别稳定。可能是由于标签数据过少导致的。

bailubin commented 1 year ago

好,谢谢您!