Thank you for sharing the code.
I meet the following problem. It seems that the kenel is not estimated successfully. Could you give me some suggestions?
G:\Anaconda\python.exe D:/2020/ReferenceCode/KernelGAN-master/train.py --input-dir test_images --real --SR
Scale Factor: X2 ZSSR: True Real Image: True
STARTED KernelGAN on: "test_images\im_1.png"...
0%| | 0/3000 [00:00<?, ?it/s]G:\Anaconda\lib\site-packages\torch\nn\modules\loss.py:93: UserWarning: Using a target size (torch.Size([13])) that is different to the input size (torch.Size([1, 1, 13, 13])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
return F.l1_loss(input, target, reduction=self.reduction)
G:\Anaconda\lib\site-packages\torch\nn\modules\loss.py:93: UserWarning: Using a target size (torch.Size([])) that is different to the input size (torch.Size([1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
return F.l1_loss(input, target, reduction=self.reduction)
G:\Anaconda\lib\site-packages\torch\nn\modules\loss.py:445: UserWarning: Using a target size (torch.Size([2])) that is different to the input size (torch.Size([2, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
return F.mse_loss(input, target, reduction=self.reduction)
100%|███████████████████| 3000/3000 [02:04<00:00, 24.18it/s]
Traceback (most recent call last):
File "G:\Anaconda\lib\site-packages\scipy\io\matlab\mio.py", line 39, in _open_file
return open(file_like, mode), True
FileNotFoundError: [Errno 2] No such file or directory: 'D:\2020\ReferenceCode\KernelGAN-master\results\test_images\im_1lll\test_images\im_1_kernel_x2.mat'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/2020/ReferenceCode/KernelGAN-master/train.py", line 54, in
main()
File "D:/2020/ReferenceCode/KernelGAN-master/train.py", line 36, in main
train(conf)
File "D:/2020/ReferenceCode/KernelGAN-master/train.py", line 18, in train
gan.finish()
File "D:\2020\ReferenceCode\KernelGAN-master\kernelGAN.py", line 124, in finish
save_final_kernel(final_kernel, self.conf)
File "D:\2020\ReferenceCode\KernelGAN-master\util.py", line 214, in save_final_kernel
sio.savemat(os.path.join(conf.output_dir_path, '%s_kernel_x2.mat' % conf.img_name), {'Kernel': k_2})
File "G:\Anaconda\lib\site-packages\scipy\io\matlab\mio.py", line 266, in savemat
with _open_file_context(file_name, appendmat, 'wb') as file_stream:
File "G:\Anaconda\lib\contextlib.py", line 113, in enter
return next(self.gen)
File "G:\Anaconda\lib\site-packages\scipy\io\matlab\mio.py", line 19, in _open_file_context
f, opened = _open_file(file_like, appendmat, mode)
File "G:\Anaconda\lib\site-packages\scipy\io\matlab\mio.py", line 45, in _open_file
return open(file_like, mode), True
FileNotFoundError: [Errno 2] No such file or directory: 'D:\2020\ReferenceCode\KernelGAN-master\results\test_images\im_1lll\test_images\im_1_kernel_x2.mat'