Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I test with my dataset, can I use the image at different resolutions? #12

Open
Huangjianglu opened this issue Jun 10, 2020 · 10 comments

Comments

@Huangjianglu
Copy link

Thanks for your great job!
I want to use my own dataset during the test,but I find that there are errors due to different image resolutions.How should I change the model parameters to change the size of the input image resolution?

@JWSoh
Copy link
Owner

JWSoh commented Jun 12, 2020

The model can be applied to any images with arbitrary resolution.
Would you please give me more information about the error?

@Huangjianglu
Copy link
Author

Thanks for your reply!
When I test the code using my dataset,the following error occurred:

=============== Load Meta-trained Model parameters... ==============
Traceback (most recent call last):
File "main.py", line 68, in
main()
File "main.py", line 58, in main
_, pp =Tester(img, gt, img_path[i])
File "/media/omnisky/77177290-c7c1-4bcd-ace1-59e97a4df5d9/MZSR-master/test.py", line 89, in call
self.quick_test()
File "/media/omnisky/77177290-c7c1-4bcd-ace1-59e97a4df5d9/MZSR-master/test.py", line 194, in quick_test
self.sr = self.forward_pass(self.img, self.gt.shape)
File "/media/omnisky/77177290-c7c1-4bcd-ace1-59e97a4df5d9/MZSR-master/test.py", line 170, in forward_pass
ILR = imresize(input, self.scale, output_shape, self.upscale_method)
File "/media/omnisky/77177290-c7c1-4bcd-ace1-59e97a4df5d9/MZSR-master/imresize.py", line 40, in imresize
img_aug[:, sym_len_Hs:sym_len_Hs+in_H,:]=img
ValueError: could not broadcast input array from shape (3,64,64) into shape (3,34,64)

@JWSoh
Copy link
Owner

JWSoh commented Jun 15, 2020

May be there could be a mismatch between the GT image shape and the scale.

Did you provide the ground-truth image?
If you don't have a ground-truth image for your dataset, you may provide an arbitrary image with the desired high-resolution shape.

@omidbazgirTTU
Copy link

I am also getting the same error as our friend @Huangjianglu is getting. I tried multiple images with different resolutions with the ground truth provided. They all give me the same error. Only in one case, the error was different (couldn't calculate the PSNR), but it also didn't save the output SR image. The saving SR image is before calculating the PSNR, so I expect it should at least save the output results.

@BassantTolba1234
Copy link

Dear Sir,
Amazing work ! Congratulation!!
please , I have a question.can you kindly provide me with the full path I should insert of checkpoint the trained large scale training model to be able to use it as a pre-trained to meta transfer training?
I'm waiting for your reply.
Thanks in advance

@784682065
Copy link

784682065 commented Dec 19, 2020

Thanks for your reply!
When I test the code using my dataset,the following error occurred:

=============== Load Meta-trained Model parameters... ==============
Traceback (most recent call last):
File "main.py", line 68, in
main()
File "main.py", line 58, in main
_, pp =Tester(img, gt, img_path[i])
File "/media/omnisky/77177290-c7c1-4bcd-ace1-59e97a4df5d9/MZSR-master/test.py", line 89, in call
self.quick_test()
File "/media/omnisky/77177290-c7c1-4bcd-ace1-59e97a4df5d9/MZSR-master/test.py", line 194, in quick_test
self.sr = self.forward_pass(self.img, self.gt.shape)
File "/media/omnisky/77177290-c7c1-4bcd-ace1-59e97a4df5d9/MZSR-master/test.py", line 170, in forward_pass
ILR = imresize(input, self.scale, output_shape, self.upscale_method)
File "/media/omnisky/77177290-c7c1-4bcd-ace1-59e97a4df5d9/MZSR-master/imresize.py", line 40, in imresize
img_aug[:, sym_len_Hs:sym_len_Hs+in_H,:]=img
ValueError: could not broadcast input array from shape (3,64,64) into shape (3,34,64)

Have you solved this problem? I am also getting it.

@BassantTolba1234
Copy link

Please @JWSoh I'm facing a problem when i load the pretrained model , specially when it reads the checkpoint
this is the error .. how did you kindly solve it please ??

NotFoundError (see above for traceback): Key MODEL/conv7/kernel/Adam_3 not found in checkpoint
[[Node: save/RestoreV2_69 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_69/tensor_names, save/RestoreV2_69/shape_and_slices)]]

@BassantTolba1234
Copy link

Please @784682065 I'm facing a problem when i load the pretrained model , specially when it reads the checkpoint
this is the error .. how did you kindly solve it please ??

NotFoundError (see above for traceback): Key MODEL/conv7/kernel/Adam_3 not found in checkpoint
[[Node: save/RestoreV2_69 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_69/tensor_names, save/RestoreV2_69/shape_and_slices)]]

@784682065
Copy link

Please @784682065 I'm facing a problem when i load the pretrained model , specially when it reads the checkpoint
this is the error .. how did you kindly solve it please ??

NotFoundError (see above for traceback): Key MODEL/conv7/kernel/Adam_3 not found in checkpoint
[[Node: save/RestoreV2_69 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_69/tensor_names, save/RestoreV2_69/shape_and_slices)]]

Sorry, I haven't encountered this problem.

@BassantTolba1234
Copy link

BassantTolba1234 commented Dec 21, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants