Closed TianMingChen closed 5 years ago
You need to follow the directions given on the Cityscapes repository.
See this file for more details:
You need to follow the directions given on the Cityscapes repository.
See this file for more details:
when I run main.py,how should I to deal this problem?
I have python createTrainIdLabelImgs.py
You have 255 value in your label files. Use this file from ESPNetv2.
https://github.com/sacmehta/ESPNetv2/blob/master/segmentation/loadData.py
Also, use this Dataset.py file
https://github.com/sacmehta/ESPNetv2/blob/master/segmentation/DataSet.py
Also, use this Dataset.py file
https://github.com/sacmehta/ESPNetv2/blob/master/segmentation/DataSet.py
I replace the two file ,but it still have such problem?
You have 255 in labels. Please change loadData.py file as below.
Replace below code
unique_values = np.unique(label_img)
# if you have 255 label in your label files, map it to the background class (19) in the Cityscapes dataset
if 255 in unique_values:
label_img[label_img==255] = 19
with
unique_values = np.unique(label_img)
# if you have 255 label in your label files, map it to the background class (19) in the Cityscapes dataset
if 255 in unique_values:
label_img[label_img==255] = 19
unique_values = np.unique(label_img)
You have 255 in labels. Please change loadData.py file as below.
Replace below code
unique_values = np.unique(label_img) # if you have 255 label in your label files, map it to the background class (19) in the Cityscapes dataset if 255 in unique_values: label_img[label_img==255] = 19
with
unique_values = np.unique(label_img) # if you have 255 label in your label files, map it to the background class (19) in the Cityscapes dataset if 255 in unique_values: label_img[label_img==255] = 19 unique_values = np.unique(label_img)
OK,the problem has been solved! Thank you ! And also when PyTorch>=0.5, the index of 0-dim tensor is invalid. The master branch is designed for PyTorch 0.4.1, loss.data[0] works well. Try to change epoch_loss.append(loss.data[0]) to epoch_loss.append(loss.data)
You should use loss.item() instead of loss.data for PyTorch version greater than 0.3
You should use loss.item() instead of loss.data for PyTorch version greater than 0.3
OK,thanks!
Hi , I am new to segmentation field, and I meet the problem about how to convert the Cityscapes dataset to 19 categories. Look forward to your reply. Thank you !!