jingjin25 / LFSSR-ATO

Repository for "Light Field Spatial Super-resolution via Deep Combinatorial Geometry Embedding and Structural Consistency Regularization" , CVPR 2020
48 stars 9 forks source link

About the scale #6

Closed Nianzhen-GU closed 3 years ago

Nianzhen-GU commented 3 years ago

Is it possible that simply change scale = 3 to train the new model?

jingjin25 commented 3 years ago

@Nianzhen-GU

Hi, you can simply change the parameters of the upsampling module.

The original upsampler is:

up = []
for _ in range(int(math.log(self.scale,2))):
    up.append(nn.Conv2d(fn, 4*fn, 3, 1, 1, bias=True))
    up.append(nn.PixelShuffle(2))
    up.append(nn.ReLU(inplace=True))
self.upsampler = nn.Sequential(*up)

You can change it to:

up = []
for _ in range(int(math.log(self.scale,3))):
    up.append(nn.Conv2d(fn, 9*fn, 3, 1, 1, bias=True))
    up.append(nn.PixelShuffle(3))
    up.append(nn.ReLU(inplace=True))
self.upsampler = nn.Sequential(*up)
Nianzhen-GU commented 3 years ago

Thanks for answering! I have changed the parameters. However, I still encounter some errors. It is totally OK when I train 2X ATO network. But when I change all the parameters to 3, it will show the below error.

Screen Shot 2021-06-15 at 9 20 28 AM
jingjin25 commented 3 years ago

@Nianzhen-GU

You need to re-prepare the training data, and name the LR data as 'img_LR_3' in the H5 file.

Nianzhen-GU commented 3 years ago

I still faced some problems. After I changed the scale to 3, it cannot fix to 64.

Screen Shot 2021-06-16 at 8 06 06 PM
jingjin25 commented 3 years ago

@Nianzhen-GU

Simply change the patch size to make it divisible by 3.

Nianzhen-GU commented 3 years ago

Problem solved, thanks!