Lornatang / SRGAN-PyTorch

A simple and complete implementation of super-resolution paper.
Apache License 2.0
410 stars 105 forks source link

Modify the upscale_factor param #50

Closed nguyendung1612 closed 2 years ago

nguyendung1612 commented 2 years ago

when I reduce the upscale_factor value to 2 or 3, I had the problem at classifier layer. I used the DIV2K dataset. Can you help me to fix it?

Thank you! error

Lornatang commented 2 years ago

This error seems to be caused by the discriminator, please check if the discriminator input image scale is 128x128.

nguyendung1612 commented 2 years ago

This error seems to be caused by the discriminator, please check if the discriminator input image scale is 128x128.

The input image scale is 192x192 and 128x128

Lornatang commented 2 years ago

You may need to adjust the discriminator model architecture based on your input image size. If you input image size equal 96x96, change model.py 108 line to nn.Linear(512 * 6 * 6, 1024),. If you input image size equal 128x128, change model.py 108 line to nn.Linear(512 * 8 * 8, 1024),. If you input image size equal 192x192, change model.py 108 line to nn.Linear(512 * 12 * 12, 1024),.