Skip to content

transforms.functional.rotate doesn't work for grayscale images #1776

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

Closed
qfgaohao opened this issue Jan 20, 2020 · 2 comments
Closed

transforms.functional.rotate doesn't work for grayscale images #1776

qfgaohao opened this issue Jan 20, 2020 · 2 comments

Comments

@qfgaohao
Copy link

When applying the function on grayscale images, it throws the following error:

packages/torchvision/transforms/functional.py", line 729, in rotate
return img.rotate(angle, resample, expand, center, fillcolor=fill)
File "/home/xxx/local/anaconda3/envs/th/lib/python3.7/site-packages/PIL/Image.py", line 2023, in rotate
return self.transform((w, h), AFFINE, matrix, resample, fillcolor=fillcolor)
File "/home/xxx/local/anaconda3/envs/th/lib/python3.7/site-packages/PIL/Image.py", line 2337, in transform
im = new(self.mode, size, fillcolor)
File "/home/xxx/local/anaconda3/envs/th/lib/python3.7/site-packages/PIL/Image.py", line 2544, in new
return im._new(core.fill(mode, size, color))
TypeError: function takes exactly 1 argument (3 given)

It is related to the pull request #1280

@pmeier
Copy link
Collaborator

pmeier commented Jan 20, 2020

Duplicate of #1759 and closed by #1760

@rgommers
Copy link

This was fixed, closing. Thanks for the report @qfgaohao and for the fix @pmeier.

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

No branches or pull requests

3 participants