NVIDIA / semantic-segmentation

Nvidia Semantic Segmentation monorepo
BSD 3-Clause "New" or "Revised" License
1.76k stars 388 forks source link

cannot train in cityscapes! #131

Open daixiaolei623 opened 3 years ago

daixiaolei623 commented 3 years ago

Dear author. thank you for your sharing. but when i use 'python -m runx.runx scripts/train_cityscapes.yml -i' to train in cityscapes, i got the error: 'File "train.py", line 601, in main() File "train.py", line 340, in main datasets.setup_loaders(args) File "/home/dai/code/semantic_segmentation/12/semantic-segmentation-main/datasets/init.py", line 182, in setup_loaders label_transform=target_train_transform) File "/home/dai/code/semantic_segmentation/12/semantic-segmentation-main/datasets/cityscapes.py", line 167, in init self.build_epoch() File "/home/dai/code/semantic_segmentation/12/semantic-segmentation-main/datasets/base_loader.py", line 71, in build_epoch self.train) File "/home/dai/code/semantic_segmentation/12/semantic-segmentation-main/datasets/uniform.py", line 308, in build_epoch msg = "cls {} len {}".format(class_id, len(centroids[class_id])) KeyError: 0' Could you please tell me how to solve, thank you.

ArthurZucker commented 3 years ago

This means that the centroïds where not correctly created. Either the .json files are empty, or something else. I stumbled upon the same issue, only 7 centroïds where found, thus my KeyError is 7. Hope it will help you

karansapra commented 3 years ago

Its probably not point to the correct folder :)