facebookresearch/detectron2

`PIL.Image.LINEAR` no longer exists

ydshieh opened this issue ยท 14 comments

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 ๐Ÿ™

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";

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

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

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

Thanks for the fix. Closing the issue as completed.

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

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'

Hi,

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

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'

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

lcc815 commented

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

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

Right, It works.