SMSR icon indicating copy to clipboard operation
SMSR copied to clipboard

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

Open Jackyinuo opened this issue 3 years ago • 4 comments

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

Jackyinuo avatar Apr 21 '21 11:04 Jackyinuo

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

LongguangWang avatar May 09 '21 03:05 LongguangWang

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

ymtupup avatar May 11 '21 08:05 ymtupup

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

X-rap-rose avatar Jun 10 '21 12:06 X-rap-rose

已解决: 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)

msx-123 avatar Jan 03 '22 09:01 msx-123