megvii-research / TLC

Test-time Local Converter
Other
225 stars 10 forks source link

AssertionError: Image shapes are differnet: (80, 120, 3), (320, 480, 3) #13

Closed bobozy1999 closed 1 year ago

bobozy1999 commented 1 year ago

Thanks for your enjoy!

I have a try in Rain100L dataset of my own trained net, but when calculating PSNR and SSIM, it gives me " AssertionError: Image shapes are differnet: (80, 120, 3), (320, 480, 3)". The size of my train test is (320,480).

Look for your reply,thank you!

achusky commented 1 year ago

Hi, thanks for your interest for this repo.

Based on the information you provided, I suspect that the output of the model is 1/4 of the test image. You need to check the scale setting in config (e.g., scale=1 for deblurring). You may set scale=4 (need to be 1) so that the input images are downsampled by 4x. If you can provide more information it would be very helpful for me to debug.

If my answer didn't solve your problem, feel free to ask again and I will contact you with WeChat.

bobozy1999 commented 1 year ago

Hi, thanks for your interest for this repo.

Based on the information you provided, I suspect that the output of the model is 1/4 of the test image. You need to check the scale setting in config (e.g., scale=1 for deblurring). You may set scale=4 (need to be 1) so that the input images are downsampled by 4x. If you can provide more information it would be very helpful for me to debug.

If my answer didn't solve your problem, feel free to ask again and I will contact you with WeChat. “AssertionError: Image shapes are differnet: (80, 120, 3), (320, 480, 3).” 我把sclae设置成了1或者4,都会出现了以上的error

bobozy1999 commented 1 year ago

My problem has been solved. https://github.com/megvii-research/TLC/blob/main/basicsr/models/image_restoration_model.py#L28 output = output[-1] to output = output[0] The author have been very helpful in solving the problem, and I would like to thank him again.