최말짱 블로그

AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' 본문

에러정리

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

최말짱 2023. 12. 5. 15:03
728x90

 

pytorch-template을 통해 MNIST 예제를 실행하던 도중 발생한 에러

 

 

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

 

 

찾아보니 PIL(10.0.0)에는 더이상 ANIALIAS 모듈이 사용되지 않는다고 한다.

그래서 PIL을 9.5로 다운그레이드 해주면 해결 할 수 있다.

 

# 9.5 버전으로 다운그레이드 해주기
pip install --force-reinstall -v "Pillow==9.5.0"

 

https://stackoverflow.com/questions/76616042/attributeerror-module-pil-image-has-no-attribute-antialias

 

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

Trying to have images in my Tkinter GUI, hence using PIL. Image.ANTIALAIS is not working, however Image.BILINEAR works Here's some sample code: import tkinter as tk from PIL import Image, ImageTk

stackoverflow.com