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

Pillow支持的版本太低AttributeError: 'ImageDraw' object has no attribute 'textsize' #1819

Open
livingbody opened this issue Jul 17, 2024 · 1 comment
Assignees

Comments

@livingbody
Copy link

Checklist:

在检测数据集时报错AttributeError: 'ImageDraw' object has no attribute 'textsize'

描述问题

/home/aistudio/PaddleX
Traceback (most recent call last):
  File "/home/aistudio/PaddleX/paddlex/utils/result_saver.py", line 30, in wrap
    result = func(self, *args, **kwargs)
  File "/home/aistudio/PaddleX/paddlex/engine.py", line 39, in run
    return dataset_checker.check()
  File "/home/aistudio/PaddleX/paddlex/modules/base/dataset_checker/dataset_checker.py", line 75, in check
    attrs = self.check_dataset(dataset_dir)
  File "/home/aistudio/PaddleX/paddlex/modules/image_classification/dataset_checker/__init__.py", line 77, in check_dataset
    return check(dataset_dir, self.output)
  File "/home/aistudio/PaddleX/paddlex/modules/image_classification/dataset_checker/dataset_src/check_dataset.py", line 105, in check
    vis_im = draw_label(img, label, label_map_dict)
  File "/home/aistudio/PaddleX/paddlex/modules/image_classification/dataset_checker/dataset_src/utils/visualizer.py", line 65, in draw_label
    text_width_tmp, text_height_tmp = draw.textsize(
AttributeError: 'ImageDraw' object has no attribute 'textsize'

复现

运行

python main.py -c paddlex/configs/image_classification/PP-LCNet_x1_0.yaml \
    -o Global.mode=check_dataset \
    -o Global.dataset_dir=./dataset/cls_flowers_examples

环境

Pillow版本10.0以上
aistudio paddlepaddle 3.0

@cuicheng01
Copy link
Collaborator

收到,感谢反馈,这个是不同pillow版本引起的,我们最近会升级适配各个pillow版本。您暂时可以通过安装9.5版本解决

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

3 participants