sefibk / KernelGAN

Other
337 stars 77 forks source link

How do I read the saved Kernel #46

Closed zerodohero closed 3 years ago

zerodohero commented 3 years ago
sio.savemat(os.path.join(conf.output_dir_path, '%s_kernel_x2.mat' % conf.img_name), {'Kernel': k_2})
if conf.X4:
    k_4 = analytic_kernel(k_2)
    sio.savemat(os.path.join(conf.output_dir_path, '%s_kernel_x4.mat' % conf.img_name), {'Kernel': k_4})

Above is the code to save kernel. I try to read it with the following code:

 k_2=kernel = scipy.io.loadmat("./model/1004141-6h-A1_kernel_x2.mat")['kernel']

However, the following error is indicated. How should I read and apply it correctly

WARNING:tensorflow:From D:\sofe\anaconda\lib\site-packages\tensorflow_core\python\compat\v2_compat.py:65: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term Traceback (most recent call last): File "D:/docum/PycharmProjects/KernelGAN-master/ZSSRforKernelGAN/test.py", line 25, in k_2=kernel = scipy.io.loadmat("./model/1004141-6h-A1_kernel_x2.mat")['kernel'] KeyError: 'kernel'