EDSR-PyTorch icon indicating copy to clipboard operation
EDSR-PyTorch copied to clipboard

i need help,thanks! ValueError: num_samples should be a positive integer value, but got num_samples=0

Open Hunter-Murphy opened this issue 4 years ago • 16 comments

when i used the “” to train the EDSR model from the scratch,i met the error : Traceback (most recent call last): File "main.py", line 33, in main() File "main.py", line 22, in main loader = data.Data(args) File "E:\红外成像仪\code\EDSR-PyTorch-master\src\data_init_.py", line 34, in init num_workers=args.n_threads, File "C:\ProgramData\Anaconda3\envs\py37pt0.4.1\lib\site-packages\torch\utils\data\dataloader.py", line 213, in init sampler = RandomSampler(dataset) File "C:\ProgramData\Anaconda3\envs\py37pt0.4.1\lib\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 can i do to solve it ?i deed help, thanks.

Hunter-Murphy avatar Aug 20 '20 13:08 Hunter-Murphy

add the '--test_only' after your test commend

JaChouSSS avatar Sep 17 '20 11:09 JaChouSSS

@Hunter-Murphy

JaChouSSS avatar Sep 17 '20 11:09 JaChouSSS

thanks very very much!!but i still encounter some severe errors when i reimplement the source code of the EDSR using my own datasets,i want to ask you some questions,here is my email address([email protected]).May I ask your email addressl?thanks again

Hunter-Murphy avatar Sep 17 '20 12:09 Hunter-Murphy

@JaChouSSS

Hunter-Murphy avatar Sep 17 '20 12:09 Hunter-Murphy

@JaChouSSS

hi,my email is [email protected]

JaChouSSS avatar Sep 18 '20 07:09 JaChouSSS

Did you solve the problem? How? Thank you i also meet this problem when i use the " python main.py --model EDSR --scale 2 --save edsr_x2 --n_resblocks 32 --n_feats 256 --res_scale 0.1 --reset --ext sep-reset " to train the model

yjt9299 avatar Sep 22 '20 06:09 yjt9299

@Hunter-Murphy

yjt9299 avatar Sep 22 '20 06:09 yjt9299

add the '--test_only' after your test commend

If i want train the model and i meet this error how can i solve it ? Thank u

yjt9299 avatar Sep 22 '20 06:09 yjt9299

i get it . i made a mistake on the dir_data

yjt9299 avatar Sep 22 '20 06:09 yjt9299

Not yet,i am still trying to solve it! Cause im busy these days,but i will try to solve it again in the next few days. Just keep in touch! thanks for you help!@yjt9299

Hunter-Murphy avatar Sep 22 '20 11:09 Hunter-Murphy

I have the same problem with you. If you have solved the problem please help me. Thanks. e-mail:[email protected] @Hunter-Murphy

flag16 avatar Mar 08 '21 06:03 flag16

看这个邮箱好像都是中国老铁啊

qizhou000 avatar Mar 09 '21 07:03 qizhou000

@yjt9299 Not so sure if you can explain more on how you could solve the problem? It looks like I had encounter the same issue here and though I change my dir_data's default directory for several times it still not works. By the way you can contact me through [email protected]. Thanks again!

fac33 avatar Oct 10 '21 00:10 fac33

@fac33 @qizhou000 @Hunter-Murphy @flag16 Hi, guys! Just change the 'dir_data' in 'option.py' correctly then this bug will be fixed. For example, you can do it like this, '/home/aaa/bbb/DIV2K/'--->'/home/aaa/bbb/' Hope this works.

WithWheat avatar Nov 23 '21 09:11 WithWheat

@fac33 @qizhou000 @Hunter-Murphy @flag16 Hi, guys! Just change the 'dir_data' in 'option.py' correctly then this bug will be fixed. For example, you can do it like this, '/home/aaa/bbb/DIV2K/'--->'/home/aaa/bbb/' Hope this works.

thank you for your help

baba1587 avatar Dec 24 '21 09:12 baba1587

I have the same problem with you. If you have solved the problem please help me. Thanks. e-mail:[[email protected]] @Hunter-Murphy

TiamoV58756565745345 avatar Aug 13 '22 12:08 TiamoV58756565745345