Es bleibt der Titel.
Wenn ich auf die neueste Version von Pillow 7.0.0 aktualisiere und den Code ausführe, der die Pytorch-Transformation enthält, erhalte ich:
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'
Dies ist auf die Kissenversion 7.0.0 zurückzuführen, die im Jahr 2020 veröffentlicht wurde.
https://pypi.org/project/Pillow/7.0.0/
Um dies zu vermeiden, geben Sie bei der Installation des Kissens die vorherige Version an.
pipenv install pillow==6.2.1
Recommended Posts