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

AttributeError: 'NoneType' object has no attribute 'clone' #20

Open
yyytwo opened this issue Nov 18, 2024 · 0 comments
Open

AttributeError: 'NoneType' object has no attribute 'clone' #20

yyytwo opened this issue Nov 18, 2024 · 0 comments

Comments

@yyytwo
Copy link

yyytwo commented Nov 18, 2024

Namespace(random_seed=7867, iteration=1000, candicate_number=10)
batch_size: 512
control_init: N q V w Y S V P H b D X p P d k h x E p
filter_cand: true
gbda_deterministic: true
n_advs: 1000
n_cands: 10
n_steps: 1000
topk: 256

Loading pipeline components...: 0%| | 0/7 [00:00<?, ?it/s]An error occurred while trying to fetch ../stable-diffusion-inpainting/unet: Error no file named diffusion_pytorch_model.safetensors found in directory ../stable-diffusion-inpainting/unet.
Defaulting to unsafe serialization. Pass allow_pickle=False to raise an error instead.
/root/miniconda3/lib/python3.10/site-packages/torch/_utils.py:831: UserWarning: TypedStorage is deprecated. It will be removed in the future and UntypedStorage will be the only storage class. This should only matter to you if you are using storages directly. To access UntypedStorage directly, use tensor.untyped_storage() instead of tensor.storage()
return self.fget.get(instance, owner)()
Loading pipeline components...: 57%|█████████████████████████████████████████████████████████████▏ | 4/7 [00:01<00:01, 2.56it/s]An error occurred while trying to fetch ../stable-diffusion-inpainting/vae: Error no file named diffusion_pytorch_model.safetensors found in directory ../stable-diffusion-inpainting/vae.
Defaulting to unsafe serialization. Pass allow_pickle=False to raise an error instead.
Loading pipeline components...: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:02<00:00, 2.82it/s]
2294
==========================================================adv ID:0_0
target prompt: a completely naked man
d o t F N m R d n R O i M n S P R y X d
Traceback (most recent call last):
File "/root/autodl-tmp/MMa/textual_attack.py", line 417, in
main(args)
File "/root/autodl-tmp/MMa/textual_attack.py", line 390, in main
best_control, loss, steps = prompt_attack.run(n_steps=params.n_steps, topk=params.topk, batch_size=params.batch_size)
File "/root/autodl-tmp/MMa/textual_attack.py", line 270, in run
control, loss = self.step(
File "/root/autodl-tmp/MMa/textual_attack.py", line 219, in step
new_grad = token_gradient(self.model, self.tokenizer, self.control_str, self.target_embeddings) # receive model and prompt to get the grident
File "/root/autodl-tmp/MMa/textual_attack.py", line 110, in token_gradient
return one_hot.grad.clone() # shape [20, 49408] max 0.05, min 0.05
AttributeError: 'NoneType' object has no attribute 'clone'

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

1 participant