sanghyun-son / EDSR-PyTorch

PyTorch version of the paper 'Enhanced Deep Residual Networks for Single Image Super-Resolution' (CVPRW 2017)
MIT License
2.43k stars 669 forks source link

Report an error when ran test #68

Closed ScapeQin closed 6 years ago

ScapeQin commented 6 years ago

Making model... Loading model from ../experiment/EDSR_x2/model/model_best.pt

Evaluation: 0it [00:00, ?it/s] Traceback (most recent call last): File "main.py", line 18, in while not t.terminate(): File "/mnt/lustre/ganyukang/Data_t1/shiyukai/eccv/EDSR-PyTorch-master/src/trainer.py", line 138, in terminate self.test() File "/mnt/lustre/ganyukang/Data_t1/shiyukai/eccv/EDSR-PyTorch-master/src/trainer.py", line 110, in test self.ckp.log[-1, idx_scale] = eval_acc / len(self.loader_test) ZeroDivisionError: division by zero

ScapeQin commented 6 years ago

I ran this command:python main.py --data_test Set14 --scale 2 --n_resblocks 32 --n_feats 256 --res_scale 0.1 --pre_train ../experiment/EDSR_x2/model/model_best.pt --test_only --dir_data=../../benchmark

Iamanorange commented 6 years ago

Check if your input data path (../../benchmark/HR and ../../benchmark/LR_bicubic) is empty, or doesn't contain any *.png file, or cann't be accessed by current user.

ScapeQin commented 6 years ago

@Iamanorange ok,thanks. I read the code and have solved it

wbhu commented 5 years ago

Hi @ScapeQin @Iamanorange ,

Sorry for bothering you. What's the folder hierarchical structure of the benchmark? I cannot reproduce the PSNR results reported in the paper using pretrained model.

Thx a lot.

ScapeQin commented 5 years ago

@crisb-DUT change data/init.py line22: from testset = getattr(module_test, 'Benchmark')(args, train=False) to testset = getattr(module_test, 'Benchmark')(args, name=args.data_test, train=False)