Open kikiki1121 opened 5 years ago
Facing the same error, when tried on Google Colab.
ValueError: num_samples should be a positive integeral value, but got num_samples = 0
Maybe your dataset is misplaced. I slove this problem by changing the dir_data argument in src/option.py. For example,your dir_data is '/home/xxx', and your dataset is '/home/xxx/DIV2K/...'
@lz28lz28 can you explain more ? I have the same problem. My own dataset looks like this:
/home/kevin/document/dataset
└──custom2K
├──custom2K_train_HR
│ ├──0000.png
│ ├──0001.png
│ └──...
├──custom2K_train_LR_bicubic
│ ├──X2
│ │ ├──0000x2.png
│ │ ├──0001x2.png
│ │ └──...
│ ├──X3
│ └──...
└──custom2K_test_HR
And my option.py looks like this : Is it correct? Thank you for your reply.
@kevinisbest Sorry,i don‘t know where your fault is.I hope that my reply may help you. My dataset looks like this: /home/jason/Documents/jason/EDSR-PyTorch-master/DIV2K/... └──DIV2K ├──DIV2K_train_HR │ ├──0000.png │ ├──0001.png │ └──... ├──DIV2K_train_LR_bicubic │ ├──X2 │ │ ├──0000x2.png │ │ ├──0001x2.png │ │ └──... │ ├──X3 │ └──... └──... My option.py looks like this :
Still not able to evaluate the models. De dataset are located correctly but they the PSNR reported for each epoch is NaN.
The same problem, I also have faced. My dataset is: and src/option.py is: Thanks for any suggestions.
@ZhengCai024, your --dir_data
should be "/d/EDSR/EDSR-PyTorch-master/dataset/DIV2K". See if that works for you.
@kevinisbest @kikiki1121, I was able to resolve the issue by combining my training and testing sets. The way that the code works is that you specify a split with the --data_range flag that operates on a single folder containing both training and testing data. The assumption is that train data comes before test data, for example 1 - 800 are train and 801 - 810 are test. This implementation is confusing because it differs from how DIV2K is actually laid out.
I will ask you a new question. Is there a problem with torch? Is there a problem with EDSR source code? I am returning 0 to num_samples when preparing dataset. Windows 10
pytorch1.0.0 python3.6
D: EDSR \ src> python main.py --model EDSR --scale 2 --save edsr_x2 - n_resblocks 32 - n_feats 256 - res_scale 0.1 - reset 'rm' is an internal or external command, It is not recognized as an operable program or batch file. Traceback (most recent call last): File "main.py", line 20, in loader = data.Data (args) File "D: \ EDSR \ src \ data \ init.py", line 30, in init pin_memory = not args.cpu File "D: \ EDSR \ src \ dataloader.py", line 167, in init worker_init_fn = worker_init_fn File "C: \ Users \ forStudent \ AppData \ Local \ conda \ conda \ envs \ ib \ site-packages \ torch \ utils \ data \ dataloader.py", line 802, in init sampler = RandomSampler (dataset) File "C: \ Users \ AppData \ Local \ conda \ conda \ envs \ lib \ site-packages \ torch \ utils \ data \ sampler.py", line 64, in init "value, but got num_samples = {}". format (self.num_samples)) ValueError: num_samples should be a positive integeral value, but got num_samples = 0
have you resolved this problem?I also get this error,can you give some advice?
Still not able to evaluate the models. De dataset are located correctly but they the PSNR reported for each epoch is NaN.
Have you solved this NaN problem
The same problem, I also have faced. My dataset is: and src/option.py is: Thanks for any suggestions.
@kikiki1121 hello,i meet the same problem,could you please give some advise for it?
@ZhengCai024 hello,i meet the same problem,could you please give some advise for it?
The same problem, I also have faced. My dataset is: and src/option.py is: Thanks for any suggestions.
I solve the probelm by putting the DIV2K under the dir named dataset, and modify the argument as parser.add_argument('--dir_data', type=str, default='../dataset', help='dataset directory')
@kevinisbest Sorry,i don‘t know where your fault is.I hope that my reply may help you. My dataset looks like this: /home/jason/Documents/jason/EDSR-PyTorch-master/DIV2K/... └──DIV2K ├──DIV2K_train_HR │ ├──0000.png │ ├──0001.png │ └──... ├──DIV2K_train_LR_bicubic │ ├──X2 │ │ ├──0000x2.png │ │ ├──0001x2.png │ │ └──... │ ├──X3 │ └──... └──... My option.py looks like this :
follow this structure and change my own dataset, then I can run the code successfully! Thank you very much!
Traceback (most recent call last):
File "/Users/a58/super_resolution/EDSR-PyTorch/src/main.py", line 33, in
I will ask you a new question. Is there a problem with torch? Is there a problem with EDSR source code? I am returning 0 to num_samples when preparing dataset. Windows 10
pytorch1.0.0 python3.6
D: EDSR \ src> python main.py --model EDSR --scale 2 --save edsr_x2 - n_resblocks 32 - n_feats 256 - res_scale 0.1 - reset 'rm' is an internal or external command, It is not recognized as an operable program or batch file. Traceback (most recent call last): File "main.py", line 20, in loader = data.Data (args) File "D: \ EDSR \ src \ data \ init.py", line 30, in init pin_memory = not args.cpu File "D: \ EDSR \ src \ dataloader.py", line 167, in init worker_init_fn = worker_init_fn File "C: \ Users \ forStudent \ AppData \ Local \ conda \ conda \ envs \ ib \ site-packages \ torch \ utils \ data \ dataloader.py", line 802, in init sampler = RandomSampler (dataset) File "C: \ Users \ AppData \ Local \ conda \ conda \ envs \ lib \ site-packages \ torch \ utils \ data \ sampler.py", line 64, in init "value, but got num_samples = {}". format (self.num_samples)) ValueError: num_samples should be a positive integeral value, but got num_samples = 0