Dear organizer:
I used EDSR framework to train our model, but the official code test output is wrong? There are some grids in the output picture?
To fix this bug, we need modify the the uint2tensor4 function and tensor2uint function in the utils/utils_image.py script?
I think this is a common problem, for the fairness of the challenge, please fix this bug, Thank you.
Posted by: SUPERSR2 @ March 30, 2022, 1:51 a.m.Probably because the input range of EDSR is 0-255 and the input range of test_demo.py is 0-1. I guess...
Posted by: xiaozhongji @ March 30, 2022, 8:50 a.m.Yes, We have no time to retrain our model to fit the offcial test code, so we have to modify the uint2tensor4 function in utils scripts to get right results.
Posted by: zhouchenhui @ March 30, 2022, 9:28 a.m.Maybe you could scale the range in your model.
Posted by: xiaozhongji @ March 30, 2022, 9:31 a.m.could you show some code to me how to scale the range in my model? Does the model need to be trained again?
Posted by: zhouchenhui @ March 30, 2022, 9:34 a.m.You can add 'input *= 255.0' at the beginning of the forward function and 'output /= 255.0' at the end.
Posted by: xiaozhongji @ March 30, 2022, 9:45 a.m.I had tried the way, but it will add the run time. For the fairness, I think the best way to fix this problem is modify the uint2tensor4 and tensor2uint function.
Posted by: zhouchenhui @ March 30, 2022, 9:56 a.m.I have modified uint2tensor4 and tensor2uint function.
Posted by: chenhao @ March 30, 2022, 11:17 a.m.Conv2d is a linear operator, either your shoul scale the input or you can modify the first conv layer weights and save them scaled. such as
out = W*I+B
assume this is your input layer where "I" has numbers between 0-1
but basically the input is "255*I"
what you can try is
out = (W/255)*(255*I)+B
this means that you need to divide your weights by 255 in the first layer
for the output you need to do the opposite if you have used conv2d+depth2space operator. I am not sure about the conv2dtranspose
Best of Luck
Posted by: deepernewbie @ March 30, 2022, 12:16 p.m.It will add the run time.
I think the best way to fix this problem is modify the uint2tensor4 and tensor2uint function.