xiaoyufenfei/LEDNet

problems about cityscripts

guaiwuguba opened this issue · 7 comments

Can you tell me where the cityscapesscripts are used? I download the whole dataset including cityscapes and cityscapesscripts, but I can't find the use of scripts!

np000 commented

I downloaded cityscapes dataset and the script , but i could not understand how you are using helpers/labels.py(of cityscapes_scripts) in LEDNet project. could you please share more details.
Possibly the following error is due to the same data preparation issue.

(/home/user/.conda/envs/conda_all_3_6) user@ubuntu64:~/PycharmProjects/proj_prod/LEDNet/train$ python main.py --savedir logs --model lednet --datadir /home/user/Downloads/data --num-epochs 10 --batch-size 10
========== ENCODER TRAINING ===========
/home/user/Downloads/data/leftImg8bit/train
/home/user/Downloads/data/leftImg8bit/val
<class 'utils.loss.CrossEntropyLoss2d'>
----- TRAINING - EPOCH 1 -----
LEARNING RATE: 0.0005
Traceback (most recent call last):
File "main.py", line 510, in
main(parser.parse_args())
File "main.py", line 464, in main
model = train(args, model, True) #Train encoder
File "main.py", line 211, in train
for step, (images, labels) in enumerate(loader):
File "/home/user/.conda/envs/conda_all_3_6/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 582, in next
return self._process_next_batch(batch)
File "/home/user/.conda/envs/conda_all_3_6/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/home/user/.conda/envs/conda_all_3_6/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/user/.conda/envs/conda_all_3_6/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/user/PycharmProjects/proj_prod/LEDNet/utils/dataset.py", line 86, in getitem
filenameGt = self.filenamesGt[index]
IndexError: list index out of range

Please support. Thanks!!

np000 commented

@guaiwuguba could you please give more idea on how to generate train ID and how to use it with LEDNet. Thanks!

You can run the code in cityscapesscripts/preparation/createTrainIdLabelImgs.py. But the trainid mask are not necessary, you can use the raw dataset.

Please follow the tutorial to deal with Cityscapes. The training uses the trainId. You need to prepare the data set with preparation/createTrainIdLabelImgs.py.
https://github.com/mcordts/cityscapesScripts

Please follow the tutorial to deal with Cityscapes. The training uses the trainId. You need to prepare the data set with preparation/createTrainIdLabelImgs.py.
https://github.com/mcordts/cityscapesScripts

你好,请问能在datasets里面放几张图片吗,这样大家看到训练数据格式一目了然。我要训练自己制作的数据集,不知道要做成什么样的格式。谢谢!!