greatlog / DAN

This is an official implementation of Unfolding the Alternating Optimization for Blind Super Resolution
231 stars 41 forks source link

Error of testing code #4

Closed yarqian closed 3 years ago

yarqian commented 3 years ago

Many thanks for your work. When I tried to test your code by using the default settings, there are some errors. It seems that the mismatch of the output size and the gt size.

On x4 Traceback (most recent call last): File "test.py", line 119, in psnr = util.calculate_psnr(cropped_sr_img 255, cropped_gt_img 255) File "../../utils/util.py", line 698, in calculate_psnr mse = np.mean((img1 - img2) ** 2) ValueError: operands could not be broadcast together with shapes (1348,2032,3) (1144,2032,3)

On x2 Traceback (most recent call last): File "test.py", line 119, in psnr = util.calculate_psnr(cropped_sr_img 255, cropped_gt_img 255) File "../../utils/util.py", line 698, in calculate_psnr mse = np.mean((img1 - img2) ** 2) ValueError: operands could not be broadcast together with shapes (1352,2036,3) (1148,2036,3)

greatlog commented 3 years ago

Which dataset do you test on? It seems that there are some mistakes in your preprocessed datasets. You can check the sizes of input LR image and GT HR image.

yarqian commented 3 years ago

I used DIV2KRK for evaluation, and I also check the size of the input LR image and the GT HR image, they are paired for both X4 and X2. And also I did not channge any code for testing.

leeziqiang commented 2 years ago

I used DIV2KRK for evaluation, and I also check the size of the input LR image and the GT HR image, they are paired for both X4 and X2. And also I did not channge any code fo hello,i also meet this problem, Did you solve this problem?