pix2pixzero / pix2pix-zero

Zero-shot Image-to-Image Translation [SIGGRAPH 2023]
https://pix2pixzero.github.io/
MIT License
1.08k stars 79 forks source link

ImportError: cannot import name 'CrossAttention' from 'diffusers.models.attention' #32

Open wangzhen-ing opened 1 year ago

wangzhen-ing commented 1 year ago

when I run this program“edit_real”, I met question: ImportError: cannot import name 'CrossAttention' from 'diffusers.models.attention' how to solve this question

SiBensberg commented 1 year ago

Had the same problem. Downgrading diffusers to version 0.14 did the trick: python -m pip install diffusers==0.14.0

Maybe they moved the cross attention module.

wangzhen-ing commented 1 year ago

Had the same problem. Downgrading diffusers to version 0.14 did the trick: python -m pip install diffusers==0.14.0

Maybe they moved the cross attention module.

thank you very much!

wangzhen-ing commented 1 year ago

hello, Sibensberg

Sorry to bother you!

I would like to ask if you successfully ran pix2pix-zero? Can you share the specific environment version, including the Python version?

I use the official environment.yml installation environment, but the specific package version and Python version are not given. I installed python3.11, so problems often occur. Can't run this code successfully

Sorry again for bothering you, wish you a happy life!

At 2023-08-29 19:46:00, "SiBensberg" @.***> wrote:

Had the same problem. Downgrading `diffusers`` to version 0.14 did the trick: python -m pip install diffusers==0.14.0

Maybe they moved the cross attention module.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ty625911724 commented 1 year ago

I try python version 3.8, diffusers==0.12.0 spacy==3.4.4 Pydantic==1.10.8. Maybe it could be helpful.

SiBensberg commented 1 year ago

Hi @wangzhen-ing, with the versions @ty625911724 mentioned, it is working for me.

BadourAlBahar commented 9 months ago

It looks like they changed the name of CrossAttention to Attention. Not sure if these are the only changes but so far you need to fix the following: from diffusers.models.attention import Attention as CrossAttention module_name == "Attention"