cswry / SeeSR

[CVPR2024] SeeSR: Towards Semantics-Aware Real-World Image Super-Resolution
Apache License 2.0
390 stars 25 forks source link

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

Open ZifanCui opened 5 months ago

ZifanCui commented 5 months ago

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

ZifanCui commented 5 months ago

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

Shengqi77 commented 5 months ago

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

ZifanCui commented 5 months ago

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

Amygyx commented 5 months ago

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

Shengqi77 commented 5 months ago

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

Thanks! it also works for me

ZifanCui commented 5 months ago

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 commented 5 months ago

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 commented 4 months ago

what's the right way to solve the problem?

Fangzhenxuan commented 4 months ago

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

prokaryote-hgy commented 2 months ago

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

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