DeepGlobe-Road-Extraction-Challenge
DeepGlobe-Road-Extraction-Challenge copied to clipboard
Running error on train.py
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.