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

AttributeError: module 'PIL.Image' has no attribute 'LINEAR' #4

Open
LBAMAD opened this issue Jul 5, 2023 · 8 comments
Open

AttributeError: module 'PIL.Image' has no attribute 'LINEAR' #4

LBAMAD opened this issue Jul 5, 2023 · 8 comments

Comments

@LBAMAD
Copy link

LBAMAD commented Jul 5, 2023

Hi,thank you for your open source of the work!
I have the following problem:

/opt/conda/envs/vlog/lib/python3.8/site-packages/detectron2/data/transforms/transform.py:46 in   
│ ExtentTransform                                                                                  
│                                                                                                  
│    43 │   See: https://pillow.readthedocs.io/en/latest/PIL.html#PIL.ImageTransform.ExtentTrans   
│    44 │   """                                                                                    
│    45 │                                                                                          
│    46 │   def __init__(self, src_rect, output_size, interp=Image.LINEAR, fill=0):                
│    47 │   │   """                                                                                
│    48 │   │   Args:                                                                              
│    49 │   │   │   src_rect (x0, y0, x1, y1): src coordinates          

AttributeError: module 'PIL.Image' has no attribute 'LINEAR'

Thank for your answer.

@QinghongLin
Copy link
Collaborator

Hi, it seems this error happened in PIL.Image package, can you try installing a different version of Pillow and see whether can i work? (e.g. pip install Pillow==8.2.0)

@LBAMAD
Copy link
Author

LBAMAD commented Jul 12, 2023

@QinghongLin Thank,I have installed the new version of pillow.
However,I have the following new problem.
/opt/conda/envs/vlog/lib/python3.8/typing.py:774 in subclasscheck
│ 771 │ def subclasscheck(self, cls):
│ 772 │ │ if self._special:
│ 773 │ │ │ if not isinstance(cls, _GenericAlias):
│ 774 │ │ │ │ return issubclass(cls, self.origin)
│ 775 │ │ │ if cls._special:
│ 776 │ │ │ │ return issubclass(cls.origin, self.origin)
│ 777 │ │ raise TypeError("Subscripted generics cannot be used with"
TypeError: issubclass() arg 1 must be a class
Maybe the other package version is wrong,can you help me?Thank you!

@QinghongLin
Copy link
Collaborator

Sure, have checked my package, here is what I have:
pip install Pillow==10.0.0

Please try it and let me know, thx!

@LBAMAD
Copy link
Author

LBAMAD commented Jul 13, 2023

@QinghongLin When I install the pillow==10.0.0,the following error reported again.
AttributeError: module 'PIL.Image' has no attribute 'LINEAR'
So,how can i resolve the problem,please help me,thank you!

@QinghongLin
Copy link
Collaborator

@LBAMAD , can you try to install this version?
Pillow==7.1.2

@AIexanderDicke
Copy link

I had the same problems as described by @LBAMAD. Installing Pillow==9.5.0 fixed it for me.

@KBHASKAR306
Copy link

I had the same problem with Pillow==10.1.0

@Das-AnupKumar
Copy link

Installing Pillow==9.5.0 fixed it for me too! Thanks @AIexanderDicke

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

5 participants