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

ValueError: num_samples should be a positive integer value, but got num_samples=0 #217

Closed
David13579246810 opened this issue Sep 13, 2019 · 3 comments

Comments

@David13579246810
Copy link

I cannot run the QuickStart(Demo) to test the algorithm with a image in the test folder.
I put the image in the test folder(EDSR-Pytorch/test), and I run the demo.sh in the src folder
the error happen like _this:
Traceback (most recent call last): File "main.py", line 33, in <module> main() File "main.py", line 22, in main loader = data.Data(args) File "/home/liangjc/Desktop/EDSR-PyTorch/src/data/__init__.py", line 31, in __init__ num_workers=args.n_threads, File "/home/liangjc/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 213, in __init__ sampler = RandomSampler(dataset) File "/home/liangjc/anaconda3/lib/python3.6/site-packages/torch/utils/data/sampler.py", line 94, 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
what's more, my pytorch is 1.2.0, my python is 3.6.5, I download the code directly with "git clone https://github.com/thstkgus35/EDSR-PyTorch.git "
thanks for your help

@David13579246810
Copy link
Author

I have solved the problem. I have to uncomment the special line in the demo.sh, only in this way can I
do the test

@ACer008
Copy link

ACer008 commented Sep 16, 2019

我已经解决了这个问题。我必须取消注释demo.sh中的特殊行,只有这样才能
进行测试

I have encountered the same mistake with you. I have deleted all the # of demo. But still reported the mistake.Could you tell me how to solve it?

@David13579246810
Copy link
Author

what do you want to do? If you only want to test pictures using the model, you should uncomment the special line which have comment said "#Test your own images". And the other lines should stay commented.

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

3 participants