showlab / VLog

Transform Video as a Document with ChatGPT, CLIP, BLIP2, GRIT, Whisper, LangChain.
MIT License
528 stars 26 forks source link

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

Open LBAMAD opened 1 year ago

LBAMAD commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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

AIexanderDicke commented 1 year ago

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

KBHASKAR306 commented 7 months ago

I had the same problem with Pillow==10.1.0

Das-AnupKumar commented 4 months ago

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