DiffAttack icon indicating copy to clipboard operation
DiffAttack copied to clipboard

KeyError: 'up_cross'

Open tanlingp opened this issue 2 years ago • 6 comments

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'

tanlingp avatar May 25 '23 08:05 tanlingp

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.

WindVChen avatar May 25 '23 15:05 WindVChen

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

tanlingp avatar May 27 '23 03:05 tanlingp

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

kikyou-220 avatar Aug 03 '23 03:08 kikyou-220

The version given by the author

tanlingp avatar Aug 03 '23 03:08 tanlingp

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?

nil0330 avatar Oct 18 '23 12:10 nil0330

Hi @nil0330 ,

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

Hope this helps.

WindVChen avatar Oct 18 '23 13:10 WindVChen