Python应用运行报错,部分错误信息如下:
Traceback (most recent call last):
File “\pipelines_ootd\unet_vton_2d_blocks.py”, line 29, in
from diffusers.models.dual_transformer_2d import DualTransformer2DModel
ModuleNotFoundError: No module named ‘diffusers.models.dual_transformer_2d’
报错提示缺少diffusers.models.dual_transformer_2d模块,
from diffusers.models.dual_transformer_2d import DualTransformer2DModel
这是老版本的调用方法,在较新的版本中代码可以改为如下方式:
from diffusers.models.transformers.dual_transformer_2d import DualTransformer2DModel