Python应用运行报错,部分错误信息如下:
Traceback (most recent call last):
from .transformer_vton_2d import Transformer2DModel
File “\pipelines_ootd\transformer_vton_2d.py”, line 29, in
from diffusers.models.embeddings import CaptionProjection, PatchEmbed
ImportError: cannot import name ‘CaptionProjection’ from ‘diffusers.models.embeddings’ (\site-packages\diffusers\models\embeddings.py)
Traceback (most recent call last):
from .unet_vton_2d_condition import UNetVton2DConditionModel
File “\pipelines_ootd\unet_vton_2d_condition.py”, line 42, in
from diffusers.models.embeddings import (
ImportError: cannot import name ‘PositionNet’ from ‘diffusers.models.embeddings’ (lib\site-packages\diffusers\models\embeddings.py)
原因是你用的diffusers版本比较新,CaptionProjection,PositionNet两个导入方法已经不用了,按下面方式替换导入名就可以了
CaptionProjection -> PixArtAlphaTextProjection
PositionNet -> GLIGENTextBoundingboxProjection