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

[Bug] AttributeError: module 'modules.sd_models' has no attribute 'read_state_dict' #25

Open
Eugeoter opened this issue Feb 7, 2023 · 0 comments

Comments

@Eugeoter
Copy link

Eugeoter commented Feb 7, 2023

When I click "Run Merge", the console reports an error. The following is the error message:

#### Merge Block Weighted ####
  model_0    : animeR8_120000_0.7-animeR_41800_0.7-a3_0.3-Weighted_sum-merged_0.3-Weighted_sum-merged.ckpt [687d631c]
  model_1    : animeR_41800_0.7-a3_0.3-Weighted_sum-merged.ckpt [f93f294e]
  base_alpha : 0
  output_file: /root/autodl-tmp/stable-diffusion-webui/models/Stable-diffusion/b1-half.ckpt
  weights    : 1,1,1,1,1,1,1,1,1,1,1,1,1,0.25,0.25,0.25,0.25,0.25,0.25,0.5,0.5,0.5,0.5,0.5,0.5
  skip ids   : 2 : 0:None, 1:Skip, 2:Reset
loading animeR8_120000_0.7-animeR_41800_0.7-a3_0.3-Weighted_sum-merged_0.3-Weighted_sum-merged.ckpt [687d631c]
Traceback (most recent call last):
  File "/root/miniconda3/lib/python3.8/site-packages/gradio/routes.py", line 284, in run_predict
    output = await app.blocks.process_api(
  File "/root/miniconda3/lib/python3.8/site-packages/gradio/blocks.py", line 982, in process_api
    result = await self.call_function(fn_index, inputs, iterator)
  File "/root/miniconda3/lib/python3.8/site-packages/gradio/blocks.py", line 824, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/root/miniconda3/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/root/miniconda3/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "/root/miniconda3/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "/root/autodl-tmp/stable-diffusion-webui/extensions/sdweb-merge-block-weighted-gui-master/scripts/mbw/ui_mbw.py", line 172, in onclick_btn_do_merge_block_weighted
    result, ret_message = merge(weights=_weights, model_0=model_A, model_1=model_B, allow_overwrite=chk_allow_overwrite,
  File "/root/autodl-tmp/stable-diffusion-webui/extensions/sdweb-merge-block-weighted-gui-master/scripts/mbw/merge_block_weighted.py", line 54, in merge
    theta_0 = load_model(model_0, device)
  File "/root/autodl-tmp/stable-diffusion-webui/extensions/sdweb-merge-block-weighted-gui-master/scripts/mbw/merge_block_weighted.py", line 51, in load_model
    return sd_models.read_state_dict(model_file, map_location=_device)
AttributeError: module 'modules.sd_models' has no attribute 'read_state_dict'

I don't know how to fix it. I shell be most grateful if you can help me.

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