Giter Site home page Giter Site logo

yjn870 / espcn-pytorch Goto Github PK

View Code? Open in Web Editor NEW
63.0 63.0 16.0 2.49 MB

PyTorch implementation of Real-Time Single Image and Video Super-Resolution Using an Efficient Sub-Pixel Convolutional Neural Network (CVPR 2016)

Home Page: https://arxiv.org/abs/1609.05158

Python 100.00%
image-super-resolution

espcn-pytorch's People

Contributors

yjn870 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

espcn-pytorch's Issues

Training with different scale factor results in error

python train.py --train-file "/BLAH_BLAH/SR/91-image_x3.h5" --eval-file "/BLAH_BLAHSR/Set5_x3.h5" --outputs-dir "/BLAH_BLAH/model_run/SR_outputs" --scale 2 --lr 1e-3 --batch-size 16 --num-epochs 200 --num-workers 8 --seed 123

epoch: 0/199: 0%| | 0/2688 [00:00<?, ?it/s]

***/code/ESPCN-pytorch/venv/lib/python3.7/site-packages/torch/nn/modules/loss.py:445: UserWarning: Using a target size (torch.Size([16, 1, 51, 51])) that is different to the input size (torch.Size([16, 1, 34, 34])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
return F.mse_loss(input, target, reduction=self.reduction)

Traceback (most recent call last):
File "train.py", line 79, in
loss = criterion(preds, labels)
File "//code/ESPCN-pytorch/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(input, kwargs)
File "/
/code/ESPCN-pytorch/venv/lib/python3.7/site-packages/torch/nn/modules/loss.py", line 445, in forward
return F.mse_loss(input, target, reduction=self.reduction)
File "/
/code/ESPCN-pytorch/venv/lib/python3.7/site-packages/torch/nn/functional.py", line 2647, in mse_loss
expanded_input, expanded_target = torch.broadcast_tensors(input, target)
File "/***/code/ESPCN-pytorch/venv/lib/python3.7/site-packages/torch/functional.py", line 65, in broadcast_tensors
return _VF.broadcast_tensors(tensors)
RuntimeError: The size of tensor a (34) must match the size of tensor b (51) at non-singleton dimension 3

I assume that somewhere in the .h5 file there is a hard-coded image that was created using a scale factor of 3. Is that correct? Because it seems that some images are not scaling properly with the dataset provided in the README.md

Where is the gaussian filter?

In the paper I read

"To synthesize the low-resolution samples LR, we blur HR using a Gaussian filter and sub-sample it by the upscaling factor."

But I cannot find the line in this repository where you apply a Gaussian filter. Or did I miss something?

No increase in resolution

Hi, I ran the inference on a test image
Phot

And used the pre-trained weights provided by you.
I got 2 results:
Phot_bicubic_x3
and

Phot_espcn_x3

But I got no improvement. That is, the resolution of all the images remained almost same: 579x1032 pixels for all 3 images.

What went wrong ?

The error occured in train.py

I want to scale up x2 not x3.

So i need to use prepare.py.

And i made 2 files. One is Set5_x2.h5 for evaluating, and the other is Set14_x2.h5 for trainning.

But I have a problem when I train it.

And the error message is "ValueError: Field names only allowed for compound types".
(The error occured at line 95(for data in eval_dataloader:)

The command is python train.py --train-file "Set14_x2.h5" --eval-file "Set5_x2.h5"

Could you give me some advise?

Questions3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.