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

训练代码 在加载SD的Unet的权重时会报错 #36

Open
ZifanCui opened this issue Apr 16, 2024 · 10 comments
Open

训练代码 在加载SD的Unet的权重时会报错 #36

ZifanCui opened this issue Apr 16, 2024 · 10 comments

Comments

@ZifanCui
Copy link

image
image
我发现 UNet2DConditionModel的state_dict().keys() 和 SD的Unet的state_dict.keys()不匹配导致报错

@ZifanCui
Copy link
Author

Some weights of UNet2DConditionModel were not initialized from the model checkpoint at preset/models/stable-diffusion-2-base and are newly initialized

@Shengqi77
Copy link

Hello, I met the same problem. How to solve it?

@ZifanCui
Copy link
Author

ZifanCui commented Apr 17, 2024 via email

@Amygyx
Copy link

Amygyx commented Apr 17, 2024

Add 'low_cpu_mem_usage=False'. It works for me.

@Shengqi77
Copy link

Shengqi77 commented Apr 17, 2024

Add 'low_cpu_mem_usage=False'. It works for me.

Thanks! it also works for me

@ZifanCui
Copy link
Author

Add 'low_cpu_mem_usage=False'. It works for me.

This indeed does not cause an error, but some of the weights in the UNet2DConditionModel are not initialized by the weights of SD's UNet. Is this correct?

@Amygyx
Copy link

Amygyx commented Apr 17, 2024

Add 'low_cpu_mem_usage=False'. It works for me.

This indeed does not cause an error, but some of the weights in the UNet2DConditionModel are not initialized by the weights of SD's UNet. Is this correct?

Yes.

@zzksdu
Copy link

zzksdu commented May 16, 2024

what's the right way to solve the problem?

@Fangzhenxuan
Copy link

请问楼主解决了吗,我也遇到了同样的问题

@prokaryote-hgy
Copy link

Sorry, I can't solve it either, waiting for the author's reply At 2024-04-17 11:14:44, "xsqhust" @.> wrote: Hello, I met the same problem. How to solve it? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

似乎这些参数本来就不用加载?这些是新引入且参与训练的参数,不知道我理解的对不对

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

6 participants