primepake / wav2lip_288x288

MIT License
524 stars 135 forks source link

When I use hq_wav2lip_sam_train.py。 #135

Closed yuan7245 closed 3 months ago

yuan7245 commented 3 months ago

When I use python hq_wav2lip_sam_train.py --syncnet_checkpoint_path D:\BaiduNetdiskDownload\wav2lip_288x288\checkpoints\syncnet\actor\best_syncnet_actor.pth to train wav2lip, it prompts me with an error regarding the pre-trained Expert discriminator.

Traceback (most recent call last): File "D:\BaiduNetdiskDownload\wav2lip_288x288\hq_wav2lip_sam_train.py", line 652, in main() File "D:\BaiduNetdiskDownload\wav2lip_288x288\hq_wav2lip_sam_train.py", line 648, in main run() File "D:\BaiduNetdiskDownload\wav2lip_288x288\hq_wav2lip_sam_train.py", line 609, in run load_checkpoint(args.syncnet_checkpoint_path, syncnet, None, reset_optimizer=True, File "D:\BaiduNetdiskDownload\wav2lip_288x288\hq_wav2lip_sam_train.py", line 567, in load_checkpoint model.load_state_dict(new_s) File "D:\ProgramData\anaconda3\envs\w2p\lib\site-packages\torch\nn\modules\module.py", line 1497, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for SyncNet_color: Unexpected key(s) in state_dict: "face_encoder.20.conv_block.0.weight", "face_encoder.20.conv_block.0.bias", "face_encoder.20.conv_block.1.weight", "face_encoder.20.conv_block.1.bias", "face_encoder.20.conv_block.1.running_mean", "face_encoder.20.conv_block.1.running_var", "face_encoder.20.conv_block.1.num_batches_tracked", "face_encoder.21.conv_block.0.weight", "face_encoder.21.conv_block.0.bias", "face_encoder.21.conv_block.1.weight", "face_encoder.21.conv_block.1.bias", "face_encoder.21.conv_block.1.running_mean", "face_encoder.21.conv_block.1.running_var", "face_encoder.21.conv_block.1.num_batches_tracked". size mismatch for face_encoder.0.conv_block.0.weight: copying a param with shape torch.Size([16, 15, 7, 7]) from checkpoint, the shape in current model is torch.Size([32, 15, 7, 7]). size mismatch for face_encoder.0.conv_block.0.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([32]). size mismatch for face_encoder.0.conv_block.1.weight: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([32]). size mismatch for face_encoder.0.conv_block.1.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([32]). size mismatch for face_encoder.0.conv_block.1.running_mean: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([32]). size mismatch for face_encoder.0.conv_block.1.running_var: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([32]). size mismatch for face_encoder.1.conv_block.0.weight: copying a param with shape torch.Size([32, 16, 5, 5]) from checkpoint, the shape in current model is torch.Size([64, 32, 5, 5]). size mismatch for face_encoder.1.conv_block.0.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.1.conv_block.1.weight: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.1.conv_block.1.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.1.conv_block.1.running_mean: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.1.conv_block.1.running_var: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.2.conv_block.0.weight: copying a param with shape torch.Size([32, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]). size mismatch for face_encoder.2.conv_block.0.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.2.conv_block.1.weight: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.2.conv_block.1.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.2.conv_block.1.running_mean: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.2.conv_block.1.running_var: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.3.conv_block.0.weight: copying a param with shape torch.Size([32, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]). size mismatch for face_encoder.3.conv_block.0.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.3.conv_block.1.weight: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.3.conv_block.1.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.3.conv_block.1.running_mean: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.3.conv_block.1.running_var: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for face_encoder.4.conv_block.0.weight: copying a param with shape torch.Size([64, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 64, 3, 3]). size mismatch for face_encoder.4.conv_block.0.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.4.conv_block.1.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.4.conv_block.1.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.4.conv_block.1.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.4.conv_block.1.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.5.conv_block.0.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 128, 3, 3]). size mismatch for face_encoder.5.conv_block.0.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.5.conv_block.1.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.5.conv_block.1.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.5.conv_block.1.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.5.conv_block.1.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.6.conv_block.0.weight: copying a param with shape torch.Size([64, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 128, 3, 3]). size mismatch for face_encoder.6.conv_block.0.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.6.conv_block.1.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.6.conv_block.1.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.6.conv_block.1.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.6.conv_block.1.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]). size mismatch for face_encoder.7.conv_block.0.weight: copying a param with shape torch.Size([128, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 128, 3, 3]). size mismatch for face_encoder.8.conv_block.0.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 128, 3, 3]). size mismatch for face_encoder.8.conv_block.0.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]). size mismatch for face_encoder.8.conv_block.1.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]). size mismatch for face_encoder.8.conv_block.1.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]). size mismatch for face_encoder.8.conv_block.1.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]). size mismatch for face_encoder.8.conv_block.1.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]). size mismatch for face_encoder.9.conv_block.0.weight: copying a param with shape torch.Size([128, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 256, 3, 3]). size mismatch for face_encoder.9.conv_block.0.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]). size mismatch for face_encoder.9.conv_block.1.weight: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]). size mismatch for face_encoder.9.conv_block.1.bias: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]). size mismatch for face_encoder.9.conv_block.1.running_mean: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]). size mismatch for face_encoder.9.conv_block.1.running_var: copying a param with shape torch.Size([128]) from checkpoint, the shape in current model is torch.Size([256]). size mismatch for face_encoder.10.conv_block.0.weight: copying a param with shape torch.Size([256, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 256, 3, 3]). size mismatch for face_encoder.11.conv_block.0.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 256, 3, 3]). size mismatch for face_encoder.11.conv_block.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for face_encoder.11.conv_block.1.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for face_encoder.11.conv_block.1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for face_encoder.11.conv_block.1.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for face_encoder.11.conv_block.1.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for face_encoder.12.conv_block.0.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]). size mismatch for face_encoder.12.conv_block.0.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for face_encoder.12.conv_block.1.weight: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for face_encoder.12.conv_block.1.bias: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for face_encoder.12.conv_block.1.running_mean: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for face_encoder.12.conv_block.1.running_var: copying a param with shape torch.Size([256]) from checkpoint, the shape in current model is torch.Size([512]). size mismatch for face_encoder.13.conv_block.0.weight: copying a param with shape torch.Size([512, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]). size mismatch for face_encoder.14.conv_block.0.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([1024, 512, 3, 3]). size mismatch for face_encoder.14.conv_block.0.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for face_encoder.14.conv_block.1.weight: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for face_encoder.14.conv_block.1.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for face_encoder.14.conv_block.1.running_mean: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for face_encoder.14.conv_block.1.running_var: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for face_encoder.15.conv_block.0.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 3, 3]). size mismatch for face_encoder.15.conv_block.0.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for face_encoder.15.conv_block.1.weight: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for face_encoder.15.conv_block.1.bias: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for face_encoder.15.conv_block.1.running_mean: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for face_encoder.15.conv_block.1.running_var: copying a param with shape torch.Size([512]) from checkpoint, the shape in current model is torch.Size([1024]). size mismatch for face_encoder.16.conv_block.0.weight: copying a param with shape torch.Size([1024, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 3, 3]). size mismatch for face_encoder.19.conv_block.0.weight: copying a param with shape torch.Size([1024, 1024, 3, 3]) from checkpoint, the shape in current model is torch.Size([1024, 1024, 1, 1]).

1129571 commented 3 months ago

改成from models import SyncNet_color_384 as SyncNet

1129571 commented 3 months ago

改成from models import SyncNet_color_384 as SyncNet

您好,如果改成 SyncNet_color_384,这个就是训练384吗,还是288,感谢您的回复

改成384就是训练384,主要是要和训练鉴别器时import的保持一致,因为最新的代码默认是384。你需要检查两个步骤导入的网络是不是一致

yuan7245 commented 3 months ago

您的回答解决了我的问题。谢谢