harlanhong / CVPR2022-DaGAN

Official code for CVPR2022 paper: Depth-Aware Generative Adversarial Network for Talking Head Video Generation
https://harlanhong.github.io/publications/dagan.html
Other
958 stars 125 forks source link

kp_num #31

Closed MingZJU closed 2 years ago

MingZJU commented 2 years ago

It seems the param 'kp_num' is not allowed to change. When I set it to 20, error occurs:

Traceback (most recent call last): File "demo.py", line 191, in generator, kp_detector = load_checkpoints(config_path=opt.config, checkpoint_path=opt.checkpoint, cpu=opt.cpu) File "demo.py", line 46, in load_checkpoints generator.load_state_dict(ckp_generator) File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1490, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for SPADEDepthAwareGenerator: size mismatch for dense_motion_network.hourglass.encoder.down_blocks.0.conv.weight: copying a param with shape torch.Size([128, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 84, 3, 3]). size mismatch for dense_motion_network.mask.weight: copying a param with shape torch.Size([16, 128, 7, 7]) from checkpoint, the shape in current model is torch.Size([21, 148, 7, 7]). size mismatch for dense_motion_network.mask.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([21]). size mismatch for dense_motion_network.occlusion.weight: copying a param with shape torch.Size([1, 128, 7, 7]) from checkpoint, the shape in current model is torch.Size([1, 148, 7, 7]).

harlanhong commented 2 years ago

Because we set the kp_num as 15 when we trained the model. If you want to set the kp_num=20, you should retrain the model and set kp_num=20.