Open lxy5513 opened 3 years ago
When you do np.random.randint(0, len(self.noises)), most likely length of the noises is 0. Check how you specify location of the noise_data in .yml file. It should be:
noise_data: ../datasets/DF2K/Corrupted_noise**/**
Forward slash is important, because in data_loader.py script they rely on it:
self.noise_imgs = sorted(glob.glob(base + '*.png'))
The problem is that sorted(glob.glob(base + '*.png'))
gives an empty list.
Replace it by ```
self.noise_imgs = [os.path.join(root,name)
for root, dirs, files in os.walk(base)
for name in files
if name.endswith(('png'))]
`This would solve your error. Let me know whether it worked for you. `
因为提取噪声的图像块的尺寸太大了,默认是256*256,对你输入的图像而言可能太大了。
Thanks for your awesome code, I train it by my custom dataset, but some problems happened,
Could you give some advice to handle it, Thanks a lot!