Skip to content
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

PIL.Image.LINEAR no longer exists #5010

Closed
ydshieh opened this issue Jul 3, 2023 · 14 comments
Closed

PIL.Image.LINEAR no longer exists #5010

ydshieh opened this issue Jul 3, 2023 · 14 comments

Comments

@ydshieh
Copy link

ydshieh commented Jul 3, 2023

Pillow 10.0.0 is released on July 1.

The previous warning

`LINEAR` is deprecated and will be removed in Pillow 10 (2023-07-01). Use BILINEAR or Resampling.BILINEAR instead. 

is now an exception.

In detectron2, there are still usage of PIL.Image.LINEAR, fro example,

(

def __init__(self, src_rect, output_size, interp=Image.LINEAR, fill=0):
)

It would be great if such usage could be updated to avoid failure. Thank you 🙏

@github-actions github-actions bot added the needs-more-info More info is needed to complete the issue label Jul 3, 2023
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template.
The following information is missing: "Instructions To Reproduce the Issue and Full Logs"; "Your Environment";

@ydshieh
Copy link
Author

ydshieh commented Jul 3, 2023

cc @ppwwyyxx

@rayryeng
Copy link

The latest commit to master (as of July 10, 2023) has now fixed this error and has corrected it to Image.BILINEAR. This should no longer be an issue now: ff53992

@ydshieh
Copy link
Author

ydshieh commented Jul 10, 2023

Thanks! Do you have a plan for a release, even a minor version?

@rayryeng
Copy link

The change has been committed to the mainline so you should be able to install directly from Git and pip.

laknath added a commit to laknath/py-bottom-up-attention that referenced this issue Jul 11, 2023
@ydshieh
Copy link
Author

ydshieh commented Jul 11, 2023

Thanks for the fix. Closing the issue as completed.

@ydshieh ydshieh closed this as completed Jul 11, 2023
@Aman-Preet-Singh-Gulati
Copy link

Aman-Preet-Singh-Gulati commented Jul 24, 2023

I'm still facing this issue -> AttributeError: module 'PIL.Image' has no attribute 'LINEAR'
cc: @rayryeng

@rayryeng
Copy link

rayryeng commented Jul 25, 2023

I'm still facing this issue -> AttributeError: module 'PIL.Image' has no attribute 'LINEAR'
cc: @rayryeng

Try installing at the point where the issue was first fixed:

python3 -m pip install -U 'git+https://github.com/facebookresearch/detectron2.git@ff53992b1985b63bd3262b5a36167098e3dada02'

facebook-github-bot pushed a commit to pytorch/benchmark that referenced this issue Jul 31, 2023
Summary:
As reported in facebookresearch/detectron2#5010, `PIL.Image.LINEAR` no longer exists.

The Pillow requirement in `detectron2` isn't pinned, so old `detectron2` is installing the latest Pillow and causing errors in the TorchBench tests.

Pull Request resolved: #1799

Reviewed By: xuzhao9

Differential Revision: D47928411

Pulled By: msaroufim

fbshipit-source-id: 36fd447475c66c0db643b04cffd1fc8b5d4ca17f
submagr added a commit to submagr/RoomFormer that referenced this issue Aug 1, 2023
The Pillow 10.0.0 is released on July 1 and deprecated PIL.Image.LINEAR in favor or PIL.Image.BILINEAR.

See [detectron2 issue](facebookresearch/detectron2#5010) for the fix
@Moltes74
Copy link

Hi,

I still have this issue but I don't figure out how to fix it ... Can someone help me ??

@MelindaDong
Copy link

MelindaDong commented Sep 14, 2023

Hi, I'm facing the same issue, "AttributeError: module 'PIL.Image' has no attribute 'LINEAR'
And can't install 'python3 -m pip install -U 'git+https://github.com/facebookresearch/detectron2.git@ff53992b1985b63bd3262b5a36167098e3dada02'' properly, there is error 'ModuleNotFoundError: No module named 'torch''
BUT I do have torch=2.0.1 and pip=23.2.1.

Fixed by downgrade 'pillow=9.1.0'

@Rabbitzzc
Copy link

Hi, I'm facing the same issue, "AttributeError: module 'PIL.Image' has no attribute 'LINEAR' And can't install 'python3 -m pip install -U 'git+https://github.com/facebookresearch/detectron2.git@ff53992b1985b63bd3262b5a36167098e3dada02'' properly, there is error 'ModuleNotFoundError: No module named 'torch'' BUT I do have torch=2.0.1 and pip=23.2.1.

Fixed by downgrade 'pillow=9.1.0'

just run pip3 install torch

@MelindaDong
Copy link

MelindaDong commented Sep 20, 2023 via email

@lcc815
Copy link

lcc815 commented Oct 9, 2023

run pip install pillow==9.5.0 will solve this problem.

@hiepbk
Copy link

hiepbk commented Apr 19, 2024

run pip install pillow==9.5.0 will solve this problem.

Right, It works.

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

Successfully merging a pull request may close this issue.

8 participants