twtygqyy / pytorch-SRResNet

pytorch implementation for Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network arXiv:1609.04802
MIT License
481 stars 130 forks source link

Change Upscale Value #14

Open niuqun opened 6 years ago

niuqun commented 6 years ago

Dear all, this project seems to fix its upscale to 4. When I changed the upscale value to 2 in the generate_train_srresnet.m, it runs into a RunTime Error:

RuntimeError: input and target shapes do not match: input [16 x 3 x 192 x 192], target [16 x 3 x 96 x 96] at /opt/conda/conda-bld/pytorch_1532579805626/work/aten/src/THCUNN/generic/MSECriterion.cu:12

Anyone has any ideas on how to make the upscale value adaptable? Thank you!

twtygqyy commented 6 years ago

Hi, since the model is trained for fixed upscale factor of 4, if you want to use it for other scales, you will have to train with different scales. Another choice would be using some self-adaptable approaches such as vdsr.