ValueError: num_samples should be a positive integer value, but got num_samples=0
See original GitHub issueI am getting the ValueError: num_samples should be a positive integer value, but got num_samples=0 while running demo.sh
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 "/mnt/Study_Storage/Documents/Study/Projects/Stonybrook_Multimedia_AI/SuperResolution/EDSR-PyTorch/src/data/__init__.py", line 31, in __init__ num_workers=args.n_threads, File "/home/rohit/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 213, in __init__ sampler = RandomSampler(dataset) File "/home/rohit/anaconda3/lib/python3.7/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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:13
Top GitHub Comments
I have the same error, when I want to train it, but I see some people are trying to just test, that one works for me. The thing is, that in the demo.sh file un-commented line is the first command, which is right, put a # and comment that out. The line you are looking for is down in the file
#Test your own images #python main.py --data_test Demo --scale 4 --pre_train download --test_only --save_results
un-comment that command or simply run it in the terminal (without demo.sh)
I got the same error with you. Just check your dataset dir. For example, your dataset dir is ‘/dataset/DIV2K’, then you should set the parameter ‘–dir_data’ with ‘/dataset’.