zlckanata / DeepGlobe-Road-Extraction-Challenge

D-LinkNet: LinkNet with Pretrained Encoder and Dilated Convolution for High Resolution Satellite Imagery Road Extraction
http://openaccess.thecvf.com/content_cvpr_2018_workshops/papers/w4/Zhou_D-LinkNet_LinkNet_With_CVPR_2018_paper.pdf
MIT License
636 stars 195 forks source link

Running error on train.py #23

Open l53ma opened 4 years ago

l53ma commented 4 years ago

Hello, I have a question when running Python3 train.py, here is the error:

Traceback (most recent call last): File "train.py", line 39, in num_workers=4) File "/home/ev1-ws4/anaconda3/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 176, in init sampler = RandomSampler(dataset) File "/home/ev1-ws4/anaconda3/lib/python3.5/site-packages/torch/utils/data/sampler.py", line 66, in init "value, but got num_samples={}".format(self.num_samples)) ValueError: num_samples should be a positive integer value, but got num_samples=0

I output the length of "imagelist" and "trainlist", which is 6226 and 0, respectively.

imagelist = filter(lambda x: x.find('sat')!=-1, os.listdir(ROOT)) #length: 6226 trainlist = map(lambda x: x[:-8], imagelist) #length: 0 x = list(imagelist) y = list(trainlist) print(len(x), len(y))

Any ideas how to solve this problem? Many thanks.

haaaaaaanson commented 1 year ago

have you solved it?