VQGAN + CLIP 加载库和定义时出错

问题描述 投票:0回答:1

我是一名设计专业的学生,我正在尝试使用 VQGAN+CLIP 生成一些图像。我复制了文档并运行所有单元格,但是当我尝试运行“加载库和定义”单元格时,出现以下消息:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-8-c026441db553> in <cell line: 13>()
     11 from omegaconf import OmegaConf
     12 from PIL import Image
---> 13 from taming.models import cond_transformer, vqgan
     14 import torch
     15 from torch import nn, optim

7 frames
/usr/local/lib/python3.10/dist-packages/PIL/ImageFont.py in <module>
     32 
     33 from . import Image
---> 34 from ._util import isDirectory, isPath
     35 
     36 LAYOUT_BASIC = 0

ImportError: cannot import name 'isDirectory' from 'PIL._util' (/usr/local/lib/python3.10/dist-packages/PIL/_util.py)

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

我该如何解决这个问题?我不知道如何编码,英语也不是我的母语,所以如果您知道解决方案,您能一步一步向我解释吗?非常感谢你

python-imaging-library
1个回答
0
投票

你可以添加这两个代码

!pip 安装 pytorch-lightning==1.6.5

!pip install --升级 Pillow

© www.soinside.com 2019 - 2024. All rights reserved.