XieQi2015 / F-Conv

Code of TPAMI 2022
72 stars 7 forks source link

num_samples should be a positive integer value, but got num_samples=0 #1

Open ghost opened 1 year ago

ghost commented 1 year ago

When I run "python main.py --model edsr_fcnn --scale 2 --save EDSR_fcnn_x2 --n_resblocks 16 --n_feats 32 --res_scale 0.1 --epoch 150 --decay 100 --patch_size 96".

Traceback (most recent call last): File "main.py", line 35, in main() File "main.py", line 22, in main loader = data.Data(args) File "/kaggle/working/F-Conv/SRExp/src/data/init.py", line 34, in init num_workers=args.n_threads, File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 344, in init sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type] File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 108, 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

mathxiaobin commented 1 year ago

When I run "python main.py --model edsr_fcnn --scale 2 --save EDSR_fcnn_x2 --n_resblocks 16 --n_feats 32 --res_scale 0.1 --epoch 150 --decay 100 --patch_size 96".

Traceback (most recent call last): File "main.py", line 35, in main() File "main.py", line 22, in main loader = data.Data(args) File "/kaggle/working/F-Conv/SRExp/src/data/init.py", line 34, in init num_workers=args.n_threads, File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 344, in init sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type] File "/opt/conda/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 108, 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

The problem lise in the data path. Add " --dir_data='../Data' '' after the " python main.py --model RDN_fcnn --scale 2 --save RDN_fcnn_x2 --res_scale 0.1 --ini_scale 0.1 --batch_size 16 --patch_size 64 --G0 8 --kernel_size 5 --epochs 150 --decay 3-100-130 --lr 4e-4 " can solve the problem.