Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running error on train.py #23

Open
l53ma opened this issue Dec 12, 2019 · 1 comment
Open

Running error on train.py #23

l53ma opened this issue Dec 12, 2019 · 1 comment

Comments

@l53ma
Copy link

l53ma commented Dec 12, 2019

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
Copy link

have you solved it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants