VainF / DeepLabV3Plus-Pytorch

Pretrained DeepLabv3 and DeepLabv3+ for Pascal VOC & Cityscapes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IndexError: Target 225 is out of bounds.

IremYoldas opened this issue · comments

commented

I'm trying to train my own dataset with this repo. I covered my dataset to Pascal format and I changed num classes, cmap. As I searched in web this error happens because of index of classes. I can't find class ids. Please help me, I stucked in here. Thanks in advance.

Hi @IremYoldas, I guess 225 is the class ID for background pixels? If so, you can simply set the ignore_index (Line 272) to 225 to ignore it. But I think, for background pixels, 255 seems more resonable than 225. Maybe it is caused by a typo in your data transformation?

commented

We are on the same page but I have no idea where 225 came from. I set the ignore_index to 225 and my problem seems like resolved. Thank you so much for your help.