Skip to content

"reflect" padding used in Gaussian Blur Transform throws error on smaller images #6683

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

Open
themurtazanazir opened this issue Oct 3, 2022 · 0 comments
Assignees

Comments

@themurtazanazir
Copy link

themurtazanazir commented Oct 3, 2022

🐛 Describe the bug

Because of the set reflect mode in torch_pad, the GaussianBlur throws exception for smaller images.

from PIL import Image
import numpy as np
from torchvision import transforms

im  = Image.new("L", (1, 1), 255)
transforms.GaussianBlur(3, sigma=(0.1, 4.0))(im)

We should either have a parameter to set the padding mode or 'reflect' should not be used when image size is smaller than kernel size.

Thanks.

Versions

PyTorch version: 1.12.1+cu102
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.5 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.31

Python version: 3.8.13 (default, Mar 28 2022, 11:38:47) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.15.0-1020-aws-x86_64-with-glibc2.17
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: Tesla T4
Nvidia driver version: 515.65.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.3
[pip3] torch==1.12.1
[pip3] torch-summary==1.4.5
[pip3] torchvision==0.13.1
[conda] numpy 1.23.3 pypi_0 pypi
[conda] torch 1.12.1 pypi_0 pypi
[conda] torch-summary 1.4.5 pypi_0 pypi
[conda] torchvision 0.13.1 pypi_0 pypi

cc @vfdev-5 @datumbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants