ImportError: 无法从'diffusers.utils'导入名为'DIFFUSERS_SLOW_IMPORT'的内容

0 投票
1 回答
43 浏览
提问于 2025-04-12 07:52

当我使用像这样的扩散器时:

from diffusers import AutoencoderKL, DDPMScheduler, UNet2DConditionModel

我遇到了以下错误:

ImportError: cannot import name 'DIFFUSERS_SLOW_IMPORT' from 'diffusers.utils' (/opt/conda/lib/python3.10/site-packages/diffusers/utils/__init__.py)

我还尝试把版本降到0.26.3,但也没有用。

扩散器版本:0.27.2

1 个回答

0

解决了,问题出在依赖冲突上。一旦我清理了conda和pip的环境,就没问题了。

!python -m pip uninstall diffusers -y && conda uninstall diffusers -y
!conda clean -ay
!python -m pip cache purge

撰写回答