ITADN

generate_latent_gt 生成latent权重文件的时候报错。

#442Openjakeandjane 创建于 2026-03-10
J
jakeandjanecommented
不管是用官方vqgg1024哪个权重,还是自己训练出来的权重,在转换的时候都会报以下错误,这是怎么回事??? Traceback (most recent call last): File "/data/CodeFormer-v0/scripts/generate_latent_gt.py", line 35, in <module> vqgan.load_state_dict(checkpoint) ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^ File "/data/miniforge3/envs/mambat/lib/python3.13/site-packages/torch/nn/modules/module.py", line 2624, in load_state_dict raise RuntimeError( ...<3 lines>... ) RuntimeError: Error(s) in loading state_dict for VQAutoEncoder: Missing key(s) in state_dict: "encoder.blocks.17.gate", "encoder.blocks.19.gate", "encoder.blocks.21.gate", "generator.blocks.2.gate", "generator.blocks.5.gate", "generator.blocks.7.gate", "generator.blocks.8.conv.0.weight", "generator.blocks.8.conv.0.bias", "generator.blocks.8.conv.1.weight", "generator.blocks.8.conv.1.bias", "generator.blocks.11.conv.0.weight", "generator.blocks.11.conv.0.bias", "generator.blocks.11.conv.1.weight", "generator.blocks.11.conv.1.bias", "generator.blocks.14.conv.0.weight", "generator.blocks.14.conv.0.bias", "generator.blocks.14.conv.1.weight", "generator.blocks.14.conv.1.bias", "generator.blocks.17.conv.0.weight", "generator.blocks.17.conv.0.bias", "generator.blocks.17.conv.1.weight", "generator.blocks.17.conv.1.bias", "generator.blocks.20.conv.0.weight", "generator.blocks.20.conv.0.bias", "generator.blocks.20.conv.1.weight", "generator.blocks.20.conv.1.bias". Unexpected key(s) in state_dict: "generator.blocks.8.conv.weight", "generator.blocks.8.conv.bias", "generator.blocks.11.conv.weight", "generator.blocks.11.conv.bias", "generator.blocks.14.conv.weight", "generator.blocks.14.conv.bias", "generator.blocks.17.conv.weight", "generator.blocks.17.conv.bias", "generator.blocks.20.conv.weight", "generator.blocks.20.conv.bias". size mismatch for encoder.blocks.1.conv2.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3]). size mismatch for encoder.blocks.2.conv2.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3]). size mismatch for encoder.blocks.3.conv.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3]). size mismatch for encoder.blocks.4.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3]). size mismatch for encoder.blocks.5.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3]). size mismatch for encoder.blocks.6.conv.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3]). size mismatch for encoder.blocks.7.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3]). size mismatch for encoder.blocks.8.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3]). size mismatch for encoder.blocks.9.conv.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3]). size mismatch for encoder.blocks.10.conv2.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3]). size mismatch for encoder.blocks.11.conv2.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3]). size mismatch for encoder.blocks.12.conv.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3]). size mismatch for encoder.blocks.13.conv2.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3]). size mismatch for encoder.blocks.14.conv2.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3]). size mismatch for encoder.blocks.15.conv.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3]). size mismatch for encoder.blocks.16.conv2.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3]). size mismatch for encoder.blocks.17.q.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.17.k.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.17.v.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.17.proj_out.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.18.conv2.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3]). size mismatch for encoder.blocks.19.q.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.19.k.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.19.v.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.19.proj_out.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.20.conv2.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3]). size mismatch for encoder.blocks.21.q.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.21.k.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.21.v.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.21.proj_out.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for encoder.blocks.22.conv2.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3]). size mismatch for generator.blocks.1.conv2.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3]). size mismatch for generator.blocks.2.q.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.2.k.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.2.v.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.2.proj_out.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.3.conv2.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3]). size mismatch for generator.blocks.4.conv2.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3]). size mismatch for generator.blocks.5.q.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.5.k.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.5.v.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.5.proj_out.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.6.conv2.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3]). size mismatch for generator.blocks.7.q.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.7.k.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.7.v.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.7.proj_out.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 1, 1, 1]). size mismatch for generator.blocks.9.conv2.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3]). size mismatch for generator.blocks.10.conv2.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3]). size mismatch for generator.blocks.12.conv2.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3]). size mismatch for generator.blocks.13.conv2.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3]). size mismatch for generator.blocks.15.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3]). size mismatch for generator.blocks.16.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3]). size mismatch for generator.blocks.18.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3]). size mismatch for generator.blocks.19.conv2.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3]). size mismatch for generator.blocks.21.conv2.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3]). size mismatch for generator.blocks.22.conv2.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3]).
0 条评论