Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any tip to train models from scratch using cityscape dataset? #253

Open
June-Jo opened this issue Mar 4, 2021 · 1 comment
Open

Any tip to train models from scratch using cityscape dataset? #253

June-Jo opened this issue Mar 4, 2021 · 1 comment

Comments

@June-Jo
Copy link

June-Jo commented Mar 4, 2021

Hi, I'm trying to train the segmentation models using cityscape dataset(training: 2975, validation:500).

In the papers of some segmentation models, mIoU of them is over 70%.
However, I cannot reach there.

I tried pspnet, segnet, and fcns, but they just reached to 40% of mIoU.
I also tried data augmentation(scaling, random rotation, horizontal flip).
In order to ignore the background, I changed the ignore_index of loss function from 250 to 0, and the label of 250 is replaced to 0.

Did I do something wrong or is there any tip to train them from scratch?

Thanks for your help in advance.

My cfg file of pspnet is below.

model:
    arch: pspnet
data:
    dataset: cityscapes
    train_split: train
    val_split: val
    img_rows: 512
    img_cols: 1024
    path: '/home/irobot/hj/Dataset/cityscape/'
training:
    train_iters: 120000
    batch_size: 16
    val_interval: 1000
    n_workers: 16
    print_interval: 20
    optimizer:
        name: 'sgd'
        lr: 1.0e-3
        weight_decay: 0.0001
        momentum: 0.9
    loss:
        name: 'multi_scale_cross_entropy'
        size_average: True
    lr_schedule: 
        name: 'multi_step'
        milestones: [30000, 60000, 90000]
    resume: pspnet_cityscape_best_model.pkl
    augmentations:
        rotate: 10                                    #[rotate -d to d degrees]
        scale: 2048                                 #[scale to size (h,w)]
        hflip: 0.5                                     #[flip horizontally with chance p]
@June-Jo June-Jo changed the title Any tips to train models from scratch using cityscape dataset? Any tip to train models from scratch using cityscape dataset? Mar 4, 2021
@June-Jo
Copy link
Author

June-Jo commented Mar 4, 2021

I was confused of indexing method in data loader.
I noticed that 0 is not background or unlabeled but the road.....
Therefore, I changed ignore_index from 0 to 250 back.

Now the mIoU is 52% after 4 epochs and it looks like keep increasing.

I'll report after the training finishes.

P.S. I added more augmentations like below.

        rotate: 10  
        rsize: 1024 
        hflip: 0.5   
        vflip: 0.5
        brightness: 0.5
        saturation: 0.5
        contrast: 0.5
        gamma: 0.5
        hue: 0.5

pspnet reach at 65% of mIoU.
Any tips to increase further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant