tensorboard icon indicating copy to clipboard operation
tensorboard copied to clipboard

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

Open FuFuDav opened this issue 1 year ago • 1 comments

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.

FuFuDav avatar May 17 '24 10:05 FuFuDav