It remains the title.
If I upgrade to the latest version of pillow 7.0.0 and run the code that contains the pytorch transform, I get:
File "train.py", line 6, in <module>
from utils.datasets import *
File "/home/jun/Desktop/work_space/sportip/hogehoge/utils/datasets.py", line 12, in <module>
import torchvision.transforms as transforms
File "/home/jun/.local/share/virtualenvs/hogehoge-IBQiZg8J/lib/python3.6/site-packages/torchvision/__init__.py", line 4, in <module>
from torchvision import datasets
File "/home/jun/.local/share/virtualenvs/hogehoge-IBQiZg8J/lib/python3.6/site-packages/torchvision/datasets/__init__.py", line 9, in <module>
from .fakedata import FakeData
File "/home/jun/.local/share/virtualenvs/hogehoge-IBQiZg8J/lib/python3.6/site-packages/torchvision/datasets/fakedata.py", line 3, in <module>
from .. import transforms
File "/home/jun/.local/share/virtualenvs/hogehoge-IBQiZg8J/lib/python3.6/site-packages/torchvision/transforms/__init__.py", line 1, in <module>
from .transforms import *
File "/home/jun/.local/share/virtualenvs/hogehoge-IBQiZg8J/lib/python3.6/site-packages/torchvision/transforms/transforms.py", line 17, in <module>
from . import functional as F
File "/home/jun/.local/share/virtualenvs/hogehoge-IBQiZg8J/lib/python3.6/site-packages/torchvision/transforms/functional.py", line 5, in <module>
from PIL import Image, ImageOps, ImageEnhance, PILLOW_VERSION
ImportError: cannot import name 'PILLOW_VERSION'
This is due to pillow version 7.0.0 released in 2020.
https://pypi.org/project/Pillow/7.0.0/
To avoid this, specify the previous version when installing pillow.
pipenv install pillow==6.2.1
Recommended Posts