Traceback (most recent call last):
File "
File "/home/nvidia/.local/lib/python3.6/site-packages/torchvision-0.9.0-py3.6-linux-aarch64.egg/torchvision/__init__.py", line 7, in
from torchvision import datasets
File "/home/nvidia/.local/lib/python3.6/site-packages/torchvision-0.9.0-py3.6-linux-aarch64.egg/torchvision/datasets/__init__.py", line 9, in
from .fakedata import FakeData
File "/home/nvidia/.local/lib/python3.6/site-packages/torchvision-0.9.0-py3.6-linux-aarch64.egg/torchvision/datasets/fakedata.py", line 4, in
from .. import transforms
File "/home/nvidia/.local/lib/python3.6/site-packages/torchvision-0.9.0-py3.6-linux-aarch64.egg/torchvision/transforms/__init__.py", line 1, in
from .transforms import *
File "/home/nvidia/.local/lib/python3.6/site-packages/torchvision-0.9.0-py3.6-linux-aarch64.egg/torchvision/transforms/transforms.py", line 16, in
from . import functional as F
File "/home/nvidia/.local/lib/python3.6/site-packages/torchvision-0.9.0-py3.6-linux-aarch64.egg/torchvision/transforms/functional.py", line 18, in
from . import functional_pil as F_pil
File "/home/nvidia/.local/lib/python3.6/site-packages/torchvision-0.9.0-py3.6-linux-aarch64.egg/torchvision/transforms/functional_pil.py", line 207, in
def resize(img, size, interpolation=Image.BILINEAR):
AttributeError: module 'PIL.Image' has no attribute 'BILINEAR
解决:受到这篇文章启发pytorch使用踩坑import torchvision
将我原本的pillow9.1.0卸载,安装pillow8(pip3 install pillow==8)即可。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)