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

未关闭
#6,853 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python

调研方向

从 writer.add_figure 开始,沿着其 add_images 路径查找 PIL.Image.ANTIALIAS 引用。使用 Matplotlib Figure 和报告的 Pillow 10.3.0 环境重现该失败。完成标准是添加 figure 不再引发此 AttributeError。

由索引模型根据 Issue 内容生成。

描述

Environment information (required)

Linux:
image

cuda 11.4
pytorch 1.12.1
Python 3.8.18
PIL 10.3.0
tensorboard 2.14.0

I setup the environment by :
$ conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch

Issue description

When using writer.add_figure to add a figure, there is a Error:

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

The original code line in my project is:
writer.add_figure('indicator/CM', fig)
fig is a matplotlib Figure, where a confusion matrix is drawn.

It seems in the process of add_images of add_figure , it is attempted to get the attribute ANTIALIAS of PIL.Image. BUT in the recent update, it was removed! Since version 10.0.0, ANTIALIAS was already removed, but add_figure method still needs it.
image

Reproduce the problem

Add a figure to a writer. The figure draws a confusion matrix.
This should reproduce the problem.

主要语言
TypeScript
星标
7.2k
派生
1.7k
平均合并
1 天 13 小时
30 天内合并 PR
3

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tensorflow/tensorboard 的其他 Issue

查看 tensorflow/tensorboard 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。