Comments (10)
The input channel is changed from 3 to 1, and the output channel is also modified to ensure that the loaded image is grayscale.
from srgan-pytorch.
Ok, I've changed the output layer too and passed that step. Now I get RuntimeError: The size of tensor a (192) must match the size of tensor b (96) at non-singleton dimension 3
from srgan-pytorch.
This error seems to be a discriminator problem. Can you give the details of the error code line.
from srgan-pytorch.
Of course:
Traceback (most recent call last):
File "train.py", line 609, in <module>
main()
File "train.py", line 152, in main
main_worker(args.gpu, ngpus_per_node, args)
File "train.py", line 361, in main_worker
psnr_optimizer, epoch, psnr_writer, scaler, args)
File "train.py", line 443, in train_psnr
mse_loss = pixel_criterion(sr, hr)
File "/home/naldwig/Desktop/Files/SRGAN-PyTorch/env/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/naldwig/Desktop/Files/SRGAN-PyTorch/env/lib/python3.7/site-packages/torch/nn/modules/loss.py", line 528, in forward
return F.mse_loss(input, target, reduction=self.reduction)
File "/home/naldwig/Desktop/Files/SRGAN-PyTorch/env/lib/python3.7/site-packages/torch/nn/functional.py", line 2928, in mse_loss
expanded_input, expanded_target = torch.broadcast_tensors(input, target)
File "/home/naldwig/Desktop/Files/SRGAN-PyTorch/env/lib/python3.7/site-packages/torch/functional.py", line 74, in broadcast_tensors
return _VF.broadcast_tensors(tensors) # type: ignore
RuntimeError: The size of tensor a (192) must match the size of tensor b (96) at non-singleton dimension 3
from srgan-pytorch.
SR image size is 192, But HR image size is 96.
from srgan-pytorch.
Cause of error the upscale factor. When I changed the upscale factor to 2 throws an error, default parameter (4) causes no error. Do you have any idea?
from srgan-pytorch.
you set --arch srgan_2x2
?
from srgan-pytorch.
Problem solved, thanks! Maybe grayscale parameter can be added.
from srgan-pytorch.
Ok, new but similar error when calculating gmsd after first epoch:
Error:
Traceback (most recent call last):
File "train.py", line 612, in <module>
main()
File "train.py", line 152, in main
main_worker(args.gpu, ngpus_per_node, args)
File "train.py", line 370, in main_worker
dataloader=test_dataloader, model=generator, gpu=args.gpu)
File "/home/naldwig/Desktop/Files/SRGAN-PyTorch/srgan_pytorch/utils/estimate.py", line 94, in test
total_gmsd_value += gmsd_loss(sr, hr)
File "/home/naldwig/Desktop/Files/SRGAN-PyTorch/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/naldwig/Desktop/Files/SRGAN-PyTorch/srgan_pytorch/utils/image_quality_assessment/calculate_gmsd.py", line 66, in forward
out = torch.mean(self.gmsd(source * 255, target * 255))
File "/home/naldwig/Desktop/Files/SRGAN-PyTorch/srgan_pytorch/utils/image_quality_assessment/calculate_gmsd.py", line 40, in gmsd
stride=2, padding=0, groups=3)
RuntimeError: Given groups=3, weight of size [3, 1, 2, 2], expected input[19, 1, 96, 96] to have 3 channels, but got 1 channels instead
from srgan-pytorch.
GMSD support RGB image, not support gray image.
from srgan-pytorch.
Related Issues (20)
- Torch not compiled with CUDA enabled HOT 1
- TypeError: 'type' object is not subscriptable HOT 3
- TypeError: unsupported operand type(s) for |: 'torch._C._TensorMeta' and 'type' HOT 6
- Resnet Models num_blocks HOT 1
- How do you test the SRResNet Models? HOT 1
- TypeError: preprocess_one_image() missing 2 required positional arguments: 'half' and 'device' HOT 1
- model_weights_path HOT 1
- TypeError: discriminator_for_vgg() got an unexpected keyword argument 'in_channels' HOT 4
- Traceback (most recent call last): File "F:\SRGAN-PyTorch-main\test.py", line 190, in <module> main() File "F:\SRGAN-PyTorch-main\test.py", line 169, in main config["ONLY_TEST_Y_CHANNEL"], KeyError: 'ONLY_TEST_Y_CHANNEL' HOT 1
- About Training with SRGAN HOT 1
- about upscale==3 HOT 5
- train_gan.py : Model weight file not found, state_dict Missing key(s), Unexpected key(s) HOT 1
- Train Code HOT 1
- Unable to reproduce the result of SRGAN_x4-SRGAN_ImageNet.pth.tar HOT 1
- Test out of memory HOT 1
- Issues running the test.py HOT 4
- The dataset have changed? HOT 1
- AssertionError: Supplied images have different sizes torch.Size([1, 3, 2048, 2048]) and torch.Size([1, 3, 128, 128])
- There is no scheduler at saving checkpoint
- test.py doesnt save results HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from srgan-pytorch.