cswry/SeeSR

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

ZifanCui opened this issue · 11 comments

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

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

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

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

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

Thanks! it also works for me

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?

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.

what's the right way to solve the problem?

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

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: @.>

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