Skip to content

AttributeError: 'NoneType' object has no attribute 'get' #17

@xlnn

Description

@xlnn

Good a working! I try out this link: https://huggingface.co/benjamin-paine/stable-diffusion-v1-5-inpainting. Run python : python textual_attack.py -s 7867 -i 1000 -n 10. There is a error:

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...:  43%|█████▌       | 3/7 [00:00<00:00, 10.68it/s]
Traceback (most recent call last):
  File "/home/2025/MMA-Diffusion/src/textual_attack.py", line 427, in <module>
    main(args)
  File "/home/2025/MMA-Diffusion/src/textual_attack.py", line 321, in main
    pipe_inpaint = StableDiffusionInpaintPipeline.from_pretrained(
  File "/home/2025/anaconda3/envs/sd/lib/python3.10/site-packages/diffusers/pipelines/pipeline_utils.py", line 1093, in from_pretrained
    loaded_sub_model = load_sub_model(
  File "/home/2025/anaconda3/envs/sd/lib/python3.10/site-packages/diffusers/pipelines/pipeline_utils.py", line 467, in load_sub_model
    loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
  File "/home/2025/anaconda3/envs/sd/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2805, in from_pretrained
    state_dict = load_state_dict(resolved_archive_file)
  File "/home/2025/anaconda3/envs/sd/lib/python3.10/site-packages/transformers/modeling_utils.py", line 460, in load_state_dict
    if metadata.get("format") not in ["pt", "tf", "flax"]:
AttributeError: 'NoneType' object has no attribute 'get'

Process finished with exit code 1

How can i solve the problem? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions