The-Learning-And-Vision-Atelier-LAVA / SMSR

[CVPR 2021] Exploring Sparsity in Image Super-Resolution for Efficient Inference
238 stars 30 forks source link

HI,I have confirmed "main.py" and "dataset path". But there is a bug happening. #1

Open Jackyinuo opened 3 years ago

Jackyinuo commented 3 years ago

Can you help me? or showing more detailing configs file. Traceback (most recent call last): File "main.py", line 15, in loader = data.Data(args) ## data loader File "E:\SMSR-master\data__init.py", line 9, in init__ trainset = getattr(module_train, args.data_train)(args) ## load the dataset, args.data_train is the dataset name File "E:\SMSR-master\data\div2k.py", line 6, in init super(DIV2K, self).init( File "E:\SMSR-master\data\multiscalesrdata.py", line 84, in init self.repeat = args.test_every // (len(self.images_hr) // args.batch_size) ZeroDivisionError: integer division or modulo by zero

LongguangWang commented 3 years ago

Hi @Jackyinuo, sorry for the late response. It seems the reason is that len(self.images_hr) equals 0. Please re-check the training images are correctly organized and confirm dir_data (the parent path to the folder DIV2K) is updated in option.py.

image

ymtupup commented 3 years ago

Have you slove this problem? I also have this problem.

X-rap-rose commented 3 years ago

我也遇到了上面的问题,文件目录没有放错。

msx-123 commented 2 years ago

已解决: 1.首先将下载下载的数据集进入DIV2K文件夹内将DIV2K_train_HR和DIV2K_train_LR_bicubic文件名改为HR和LR_bicubic 2.其次将LR_bicubic/X2,X3,X4内部的文件全部命名为与HR文件内部一样的名字,也就是说将图片名称中的x2,x3,x4全部去掉,下面我放了重命名的代码,你们可以用,注意修改路径。 3.最后将--dir_data改成你DIV2K文件前一个目录的绝对路径,就可以了

import os import glob from PIL import Image file_root = r'E:\SMSR\SMSR-master\trainset\DIV2K\LR_bicubic\X2' for root, dirs, files in os.walk(file_root): for file in files: srcFile = os.path.join(file_root, file) dstFile = os.path.join(file_root, file.replace('x2', '')) os.rename(srcFile, dstFile)