MooreThreads / Moore-AnimateAnyone

Character Animation (AnimateAnyone, Face Reenactment)
Apache License 2.0
3.14k stars 245 forks source link

ImportError: cannot import name 'CaptionProjection' from 'diffusers.models.embeddings' #13

Closed nihilisticneuralnet closed 9 months ago

nihilisticneuralnet commented 9 months ago
Traceback (most recent call last):
  File "Moore-AnimateAnyone\app.py", line 16, in <module>
    from src.models.unet_2d_condition import UNet2DConditionModel
  File "Moore-AnimateAnyone\src\models\unet_2d_condition.py", line 40, in <module>
    from .unet_2d_blocks import (
  File "Moore-AnimateAnyone\src\models\unet_2d_blocks.py", line 15, in <module>
    from .transformer_2d import Transformer2DModel
  File "Moore-AnimateAnyone\src\models\transformer_2d.py", line 7, in <module>
    from diffusers.models.embeddings import CaptionProjection
ImportError: cannot import name 'CaptionProjection' from 'diffusers.models.embeddings' 
MrForExample commented 9 months ago

You have this error because you are using newest diffusers library

To fix, in transformer_2d.py:

Replace CaptionProjection with PixArtAlphaTextProjection

nihilisticneuralnet commented 9 months ago

Thanks. that resolved the error.