yassouali / pytorch-segmentation

:art: Semantic segmentation models, datasets and losses implemented in PyTorch.
MIT License
1.68k stars 381 forks source link

MioU is too low, the val_loss and val_MIoU curve are very weird.(deeplabv3+ and xception, Cityscapes) #119

Closed XiaXinjie closed 2 years ago

XiaXinjie commented 3 years ago

Thank you very much. I am not goot at english, but I have some questions and need some help.

the config.json: { "name": "deeplabv3_plus", "n_gpu": 1, "use_synch_bn": false,

"arch": {
    "type": "DeepLab",
    "args": {
        "backbone": "Xception",
        "freeze_bn": false,
        "freeze_backbone": false
    }
},

"train_loader": {
    "type": "CityScapes",
    "args":{
        "data_dir": "data/.....",
        "batch_size": 8,
        "base_size": 400,
        "crop_size": 380,
        "augment": true,
        "shuffle": true,
        "scale": true,
        "flip": true,
        "rotate": true,
        "blur": false,
        "split": "train_aug",
        "num_workers": 8
    }
},

"val_loader": {
    "type": "CityScapes",
    "args":{
        "data_dir": "data/......",
        "batch_size": 8,
        "crop_size": 480,
        "val": true,
        "split": "val",
        "num_workers": 4
    }
},

"optimizer": {
    "type": "SGD",
    "differential_lr": true,
    "args":{
        "lr": 0.01,
        "weight_decay": 1e-4,
        "momentum": 0.9
    }
},

"loss": "CrossEntropyLoss2d",
"ignore_index": 255,
"lr_scheduler": {
    "type": "Poly",
    "args": {}
},

"trainer": {
    "epochs": 100,
    "save_dir": "saved/",
    "save_period": 10,

    "monitor": "max Mean_IoU",
    "early_stop": 10,

    "tensorboard": true,
    "log_dir": "saved/runs",
    "log_per_iter": 20,

    "val": true,
    "val_per_epochs": 10
}

According to https://github.com/yassouali/pytorch-segmentation/pull/110#issue-620001051, I replaced the deeplabv3_plus code and used the new Xception code. The results are showing as follow:

Train_Loss Train_MIoU Train_Pixel_Acc Val_Loss Val_MIoU Val_Pixel_Acc In this results, the Validation results have some strange,I am eager to konw what's wrong.

XiaXinjie commented 3 years ago

I am sorry, "split": "train" is corret.

cm0561 commented 3 years ago

你好 可以加你联系方式吗 我最近在用这个代码 出现一样的问题 跑city数据集 时候 精度不是很理想 你解决问题了吗 我WV 18155759923

yassouali commented 2 years ago

can you try the newly added model deeplabv3_xception.py