Open jwangjie opened 5 years ago
Please check the directory of data.
@sunke123 Thank you for your reply. I wonder can I save the dataset in an external hard drive? The storage space of my local SSD is limited.
@sunke123 Thank you for your reply. I wonder can I save the dataset in an external hard drive? The storage space of my local SSD is limited.
You need to modify the DATASET
attribute in the yaml file and the __getitem__
function in the lib/datasets/cityscapes.py file. Below is my modification.
# the yaml file
DATASET:
DATASET: cityscapes
ROOT: '/media/sunsky/HDD/DATASETS/cityScape/'
TEST_SET: 'data/list/cityscapes/val.lst'
TRAIN_SET: 'list/cityscapes/train.lst'
NUM_CLASSES: 19
# lib/datasets/cityscapes.py
def __getitem__(self, index):
item = self.files[index]
name = item["name"]
image = cv2.imread(os.path.join(self.root,item["img"]),
cv2.IMREAD_COLOR)
size = image.shape
if 'test' in self.list_path:
image = self.input_transform(image)
image = image.transpose((2, 0, 1))
return image.copy(), np.array(size), name
label = cv2.imread(os.path.join(self.root,item["label"]),
cv2.IMREAD_GRAYSCALE)
label = self.convert_label(label)
image, label = self.gen_sample(image, label,
self.multi_scale, self.flip,
self.center_crop_test)
return image.copy(), label.copy(), np.array(size), name
@sunke123 Thank you for your reply. I wonder can I save the dataset in an external hard drive? The storage space of my local SSD is limited. HI,have you solved the problem , now i met the same problem as you , and i don't known how to solve it . #68
according to my test, this problem is arosed by wrong image path. When we use cityscapes to train the model, the default image path are not consistency with the path in code. For an example, /hrnet/HRNet-Semantic-Segmentation/data/cityscapes/leftImg8bit/train/stuttgart/ (path in code) /hrnet/HRNet-Semantic-Segmentation/data/cityscapes/leftImg8Bit/train/stuttgart/ (default path in cityscapes)
so, I change "leftImg8Bit" to "leftImg8bit", then it works!
...I has debuged two weeks! I did not find this word error,because i copy this datasets from other.Thanks to you solution.Thanks♪(・ω・)ノ
Hello,
When ruing the command
I got the following AttibuteError:
I wonder what the problem is? Thank you.
Regards,