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

error converting VAE on some recent SD 1.x models #404

Closed
ssube opened this issue Aug 15, 2023 · 1 comment
Closed

error converting VAE on some recent SD 1.x models #404

ssube opened this issue Aug 15, 2023 · 1 comment
Labels
model/diffusion scope/convert status/fixed issues that have been fixed and released type/bug broken features
Milestone

Comments

@ssube
Copy link
Owner

ssube commented Aug 15, 2023

[2023-08-15 12:30:26,752] INFO: 3975261 140600755074880 onnx_web.convert.diffusion.checkpoint: converting VAE   
[2023-08-15 12:30:27,143] ERROR: 3975261 140600755074880 onnx_web.convert.diffusion.checkpoint: error setting up output                                                                                                                                                              
Traceback (most recent call last):                                                                                                        
  File "/opt/onnx-web/api/onnx_web/convert/diffusion/checkpoint.py", line 1570, in extract_checkpoint           
    vae.load_state_dict(converted_vae_checkpoint)                                                                                                                                                                                                                                    
  File "/home/ssube/miniconda3/envs/onnx-web-rocm-pytorch2/lib/python3.9/site-packages/torch/nn/modules/module.py", line 2041, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(                                   
RuntimeError: Error(s) in loading state_dict for AutoencoderKL:                                                                                                                                                                                                                      
        Missing key(s) in state_dict: "encoder.mid_block.attentions.0.to_q.weight", "encoder.mid_block.attentions.0.to_q.bias", "encoder.mid_block.attentions.0.to_k.weight", "encoder.mid_block.attentions.0.to_k.bias", "encoder.mid_block.attentions.0.to_v.weight", "encoder.mid_
block.attentions.0.to_v.bias", "encoder.mid_block.attentions.0.to_out.0.weight", "encoder.mid_block.attentions.0.to_out.0.bias", "decoder.mid_block.attentions.0.to_q.weight", "decoder.mid_block.attentions.0.to_q.bias", "decoder.mid_block.attentions.0.to_k.weight", "decoder.mid
_block.attentions.0.to_k.bias", "decoder.mid_block.attentions.0.to_v.weight", "decoder.mid_block.attentions.0.to_v.bias", "decoder.mid_block.attentions.0.to_out.0.weight", "decoder.mid_block.attentions.0.to_out.0.bias". 
        Unexpected key(s) in state_dict: "encoder.mid_block.attentions.0.key.bias", "encoder.mid_block.attentions.0.key.weight", "encoder.mid_block.attentions.0.proj_attn.bias", "encoder.mid_block.attentions.0.proj_attn.weight", "encoder.mid_block.attentions.0.query.bias", "en
coder.mid_block.attentions.0.query.weight", "encoder.mid_block.attentions.0.value.bias", "encoder.mid_block.attentions.0.value.weight", "decoder.mid_block.attentions.0.key.bias", "decoder.mid_block.attentions.0.key.weight", "decoder.mid_block.attentions.0.proj_attn.bias", "dec
oder.mid_block.attentions.0.proj_attn.weight", "decoder.mid_block.attentions.0.query.bias", "decoder.mid_block.attentions.0.query.weight", "decoder.mid_block.attentions.0.value.bias", "decoder.mid_block.attentions.0.value.weight". 
[2023-08-15 12:30:27,144] ERROR: 3975261 140600755074880 onnx_web.convert.diffusion.checkpoint: pipeline or config is not set, unable to continue
[2023-08-15 12:30:27,291] ERROR: 3975261 140600755074880 onnx_web.convert.diffusion.checkpoint: unable to convert checkpoint to Torch model
@ssube
Copy link
Owner Author

ssube commented Dec 3, 2023

This can be fixed for now with set ONNX_WEB_CONVERT_EXTRACT=FALSE or export ONNX_WEB_CONVERT_EXTRACT=FALSE.

I need to switch that flag to false by default for v0.11.

@ssube ssube added the status/progress issues that are in progress and have a branch label Dec 3, 2023
@ssube ssube mentioned this issue Dec 3, 2023
5 tasks
@ssube ssube closed this as completed Dec 3, 2023
@ssube ssube added status/fixed issues that have been fixed and released and removed status/progress issues that are in progress and have a branch labels Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
model/diffusion scope/convert status/fixed issues that have been fixed and released type/bug broken features
Projects
None yet
Development

No branches or pull requests

1 participant