Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'up_cross' #2

Open
tanlingp opened this issue May 25, 2023 · 6 comments
Open

KeyError: 'up_cross' #2

tanlingp opened this issue May 25, 2023 · 6 comments

Comments

@tanlingp
Copy link

Sorry to interrupt, code error Traceback (most recent call last).
File "main.py", line 153, in
adv_image, clean_acc, adv_acc = run_diffusion_attack(tmp_image, label[ind:ind + 1].
File "main.py", line 72, in run_diffusion_attack
adv_image, clean_acc, adv_acc = diff_latent_attack.diffattack(diffusion_model, label, controller.
File "/usr/local/lib/python3.8/dist-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/202221623173/DiffAttack-main/diff_latent_attack.py", line 369, in diffattack
before_attention_map = aggregate_attention(prompt, controller, 7, ("up", "down"), True, 0, is_cpu=False)
File "/202221623173/DiffAttack-main/utils.py", line 13, in aggregate_attention
for item in attention_maps[f"{location}_{'cross' if is_cross else 'self'}"].
KeyError: 'up_cross'

@WindVChen
Copy link
Owner

Hi @tanlingp ,

Based on the above information, I am currently unable to conclude what is causing this error. Can you take a look at your diffusers version? It might be due to the version inconsistency.

@tanlingp
Copy link
Author

Thank you very much for your help, it is indeed the reason for the wrong version

@kikyou-220
Copy link

Sorry to interrupt, I'm having this problem too, can I ask which version are you using?

@tanlingp
Copy link
Author

tanlingp commented Aug 3, 2023

The version given by the author

@nil0330
Copy link

nil0330 commented Oct 18, 2023

The version given by the author

The version given by the author

I have the same question, and I'm unsure which specific version we need. Could you please assist me in clarifying this?

@WindVChen
Copy link
Owner

Hi @nil0330 ,

You can take a look at requirements.txt for the versions of some packages.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants