Skip to content

Conversation

@rodjjo
Copy link

@rodjjo rodjjo commented Apr 14, 2023

Sort output_block_list before checking it in unet_state_dict

Fixes:

Missing key(s) in state_dict: "up_blocks.0.upsamplers.0.conv.weight", "up_blocks.0.upsamplers.0.conv.bias", "up_blocks.1.upsamplers.0.conv.weight", "up_blocks.1.upsamplers.0.conv.bias", "up_blocks.2.upsamplers.0.conv.weight", "up_blocks.2.upsamplers.0.conv.bias"

rodjjo added 2 commits April 14, 2023 13:38
When I used your script in my project https://github.com/rodjjo/diffusion-expert, It was unable to convert safetensor files.

I spend a little time and discovery that it imports if I sort the output_block_list values:

This fix the error:
```Missing key(s) in state_dict: "up_blocks.0.upsamplers.0.conv.weight", "up_blocks.0.upsamplers.0.conv.bias", "up_blocks.1.upsamplers.0.conv.weight", "up_blocks.1.upsamplers.0.conv.bias", "up_blocks.2.upsamplers.0.conv.weight", "up_blocks.2.upsamplers.0.conv.bias"
````
fix(safetensor) - sort a list before checking
@8-unlimit
Copy link

Thank you so much for your work, it helps me a lot

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

Successfully merging this pull request may close these issues.

2 participants