Skip to content

Add Pillow >= 9.4 requirement#1671

Merged
ebsmothers merged 1 commit intometa-pytorch:mainfrom
ebsmothers:add-pillow-req
Sep 25, 2024
Merged

Add Pillow >= 9.4 requirement#1671
ebsmothers merged 1 commit intometa-pytorch:mainfrom
ebsmothers:add-pillow-req

Conversation

@ebsmothers
Copy link
Contributor

@ebsmothers ebsmothers commented Sep 25, 2024

torchvision nightlies come with PIL == 9.3 (at least in my env), but unless we have PIL >= 9.4 we will run into errors on our multimodal datasets around the usage of ExIfTags (ref). Ideally we can change this in torchvision, but until then gonna pin to a minimum version of PIL just to be safe.

Test plan:

conda create -n test-pillow python=3.11 -y
conda activate test-pillow
pip install --pre torch torchvision torchao --index-url https://download.pytorch.org/whl/nightly/cu121
pip list
...
Pillow                   9.3.0
...

# From torchtune directory
pip install -e .
pip list
...
pillow                   10.4.0
...

Before:

  File "/home/ebs/.conda/envs/nightly-testing-09-25/lib/python3.11/site-packages/PIL/Image.py", line 76, in __getattr__
    raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
AttributeError: module 'PIL.Image' has no attribute 'ExifTags'

After:

1|1|Loss: 0.2959183156490326:   0%|▍                                                                                                                           | 1/304 [00:27<2:20:33, 27.83s/it]

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 25, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1671

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit fe9a73f with merge base 55f29f7 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 25, 2024
Copy link
Collaborator

@RdoubleA RdoubleA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that the original error doesn't happen anymore on 9.4?

@ebsmothers ebsmothers merged commit 645e041 into meta-pytorch:main Sep 25, 2024
@ebsmothers ebsmothers deleted the add-pillow-req branch September 25, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants