question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run the configurations for SegNet on ADE20K

See original GitHub issue

Hi,

Thank you for building this useful library. I’ve been trying to run the config file for SegNet on ADE20K as a first try because I would like to run the model on my own dataset. However, I’ve got the following error. I will appreciate your help.

The error: Traceback (most recent call last): File "train.py", line 61, in <module> main(config, args.resume) File "train.py", line 22, in main train_loader = get_instance(dataloaders, 'train_loader', config) File "train.py", line 16, in get_instance return getattr(module, config[name]['type'])(*args, **config[name]['args']) TypeError: 'module' object is not callable

Here is the modified config file:

` { “name”: “SegNet”, “n_gpu”: 1, “use_synch_bn”: true,

"arch": {
    "type": "SegNet",
    "args": {
        "backbone": "resnet50",
        "freeze_bn": false,
        "freeze_backbone": false
    }
},

"train_loader": {
    "type": "ade20k",
    "args":{
        "data_dir": "ADEChallengeData2016/images/training/",
        "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": "ade20k",
    "args":{
        "data_dir": "ADEChallengeData2016/images/validation/",
        "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": 80,
    "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": 5
}

} `

I’m not sure if I modified the file correctly. Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
yassoualicommented, May 8, 2020

Thanks for the code, the problem is that for one of your labels, the class ID is > 5 or < 0 (because you have 6 classes), what you can do is add an assert to find the root of the problem, then you can find the value of the id class that causes the error and add it as an ignore class.

add this after label = np.asarray(Image.open(label_path), dtype=np.int32): assert img.max() < 6 and img.min() >= 0, f"the ID cause problem is one of {img.max()}, {img.min()} of image {image_id}"

0reactions
sarathsrkcommented, Jul 13, 2020

Did you solve this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to run the configurations for SegNet on ADE20K #56
I've been trying to run the config file for SegNet on ADE20K as a first try because I would like to run the...
Read more >
Scene Parsing through ADE20K Dataset
In a single forward pass the network with the proposed cascade module is able to parse scenes at different levels. We use the...
Read more >
Semantic Understanding of Scenes through the ADE20K ...
We show that the networks trained on. ADE20K are able to segment a wide variety of scenes and objects1. B. Zhou. Department of...
Read more >
Review — ADE20K: Semantic Understanding of Scenes ...
ADE20K dataset is constructed as the benchmarks for scene parsing and instance segmentation. The list of the objects and their associated parts ...
Read more >
Semantic Understanding of Scenes through the ADE20K ...
We then introduce a generic network design called Cascade Segmentation Module, which enables neural networks to segment stuff, objects, and object parts in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found