sacmehta / ESPNet

ESPNet: Efficient Spatial Pyramid of Dilated Convolutions for Semantic Segmentation
https://sacmehta.github.io/ESPNet/
MIT License
538 stars 111 forks source link

add ignored_Id #55

Open xufeifeiWHU opened 5 years ago

xufeifeiWHU commented 5 years ago

Thanks for @sacmehta 's talent work, I have made one change for easy using of this project,

main.py : 1. add _ignoredId argument to notice which ID (in the label file) should be ignored.

2. the default value of _ignoredId is 255 (for cityscapse trainID of )

3. using torch.nn.crossEntryLoss to replace the user defined crossEntryLoss entity, and pass _ignoredId to _ignoreIndex parameter of torch.nn.crossEntryLoss.

loaddata.py 4. when check the max_value in the label file, compare it with _ignoredId first, then print some information to notice the ignored_Id in the label file has been ignored

these changes have been verified in ubuntu 16.04 , cuda 9.0 cudnn 7.0, pytorch 1.0.0 post2, Thanks for your time and looking for your reply.