-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I wanna deal with grayscale image,it report this problem #32
Comments
Hi @WYCAS , it seems that the input tensor was a RGB image. Could you provide more detials, such as a minimal example to produce this error? |
Input :a = torch.randint(0, 255, size=( 256, 256), dtype=torch.float32).cuda() / 255. b = a * 0.5 Input:a = torch.randint(0, 255, size=(1,1,256, 256), dtype=torch.float32).cuda() / 255. b = a * 0.5 Do I have to change the grayscale image to RGB image? By the way ,when I use pytorch-msssim=0.1,it can work on grayscale image |
The ssim metric worked well on my laptop. Maybe the parameter ssim = SSIM(data_range=1., channel=1) |
thanks , It works! |
When I input 2D grayscale image ,i report this.
ValueError: Input images should be 4-d or 5-d tensors, but got torch.Size([256, 256])
Therefore,I change the input dimension to 4D(1,1,256,256),but i got this problem.
RuntimeError: Given groups=1, weight of size [3, 1, 1, 11], expected input[1, 3, 246, 256] to have 1 channels, but got 3 channels instead
The text was updated successfully, but these errors were encountered: