GeneFacePlusPlus icon indicating copy to clipboard operation
GeneFacePlusPlus copied to clipboard

RuntimeError: Error(s) in loading state_dict for RADNeRFTorsowithSR

Open liangxx29 opened this issue 1 year ago • 7 comments

--- 制作测试视频 --- INFO: Created TensorFlow Lite XNNPACK delegate for CPU. | WARN: egs/egs_bases/audio2motion/vae.yaml not exist. | WARN: checkpoints\th1kh_512_audio2motion\base.yaml not exist. | Hparams: { "accumulate_grad_batches": 1, "amp": false, "audio_type": "hubert", "base_config": [ "egs/egs_bases/audio2motion/vae.yaml", "../th1kh_512_audio2motion/base.yaml" ], "batch_size": 4, "binarization_args": { "with_coeff": true, "with_hubert": true, "with_mel": true }, "binary_data_dir": "data/binary/voxceleb2_audio2motion", "blink_mode": "blink_unit", "clip_grad_norm": 1, "clip_grad_value": 0, "debug": false, "ds_name": "TH1KH_512", "eval_max_batches": 10, "exp_name": "", "gen_dir_name": "", "hidden_size": 256, "infer": false, "infer_audio_source_name": "", "infer_ckpt_steps": 40000, "infer_out_npy_name": "", "init_from_ckpt": "", "init_method": "tcp", "lambda_kl": 0.02, "lambda_kl_t1": 2000, "lambda_kl_t2": 2000, "lambda_l2_reg_exp": 0.1, "lambda_mse_exp": 1.0, "lambda_mse_lm2d": 0.0, "lambda_mse_lm3d": 0.0, "load_ckpt": "", "load_db_to_memory": false, "lr": 0.0005, "max_sentences_per_batch": 512, "max_tokens_per_batch": 20000, "max_updates": 400000, "motion_type": "exp", "num_ckpt_keep": 100, "num_sanity_val_steps": 5, "num_valid_plots": 1, "num_workers": 4, "optimizer_adam_beta1": 0.9, "optimizer_adam_beta2": 0.999, "print_nan_grads": false, "process_id": 0, "raw_data_dir": "/home/tiger/datasets/raw/TH1KH_512", "ref_id_mode": "first_frame", "resume_from_checkpoint": 0, "sample_min_length": 32, "save_best": false, "save_codes": [ "tasks", "modules", "egs" ], "save_gt": true, "scheduler": "exponential", "seed": 9999, "smo_win_size": 5, "split_seed": 999, "start_rank": 0, "syncnet_ckpt_dir": "checkpoints/0904_syncnet/syncnet_hubert_vox2", "task_cls": "tasks.os_avatar.audio2secc_task.Audio2SECCTask", "tb_log_interval": 100, "total_process": 1, "use_eye_amp_embed": false, "use_flow": true, "use_fork": true, "use_kv_dataset": true, "use_mouth_amp_embed": true, "use_pitch": true, "val_check_interval": 2000, "valid_infer_interval": 2000, "valid_monitor_key": "val_loss", "valid_monitor_mode": "min", "validate": false, "warmup_updates": 1000, "weight_decay": 0, "work_dir": "", "world_size": -1 } | load 'model' from 'checkpoints\audio2motion_vae\model_ckpt_steps_400000.ckpt', strict=True | WARN: checkpoints\motion2video_nerf\simon_torso\lm3d_radnerf_torso.yaml not exist. Traceback (most recent call last): File "E:\AI\Geneface\inference\genefacepp_infer.py", line 610, in GeneFace2Infer.example_run(inp) File "E:\AI\Geneface\inference\genefacepp_infer.py", line 545, in example_run infer_instance = cls(inp['a2m_ckpt'], inp['postnet_ckpt'], inp['head_ckpt'], inp['torso_ckpt']) File "E:\AI\Geneface\inference\genefacepp_infer.py", line 130, in init self.secc2video_model = self.load_secc2video(head_model_dir, torso_model_dir) File "E:\AI\Geneface\inference\genefacepp_infer.py", line 177, in load_secc2video load_ckpt(model, f"{torso_model_dir}", model_name='model', strict=True) File "E:\AI\Geneface\utils\commons\ckpt_utils.py", line 67, in load_ckpt cur_model.load_state_dict(state_dict, strict=strict) File "E:\AI\Geneface\venv\lib\site-packages\torch\nn\modules\module.py", line 2041, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for RADNeRFTorsowithSR: size mismatch for blink_encoder.1.weight: copying a param with shape torch.Size([8, 32]) from checkpoint, the shape in current model is torch.Size([2, 32]). size mismatch for blink_encoder.1.bias: copying a param with shape torch.Size([8]) from checkpoint, the shape in current model is torch.Size([2]). Done

liangxx29 avatar Mar 15 '24 10:03 liangxx29

你好请问解决了吗

fjesikfjdskl avatar Mar 20 '24 01:03 fjesikfjdskl

我发现是我没正确训练模型,导致模型的眼睛和视频对不上。训练好之后就不会遇到这个问题了

On Wed, Mar 20, 2024 at 9:51 AM fjesikfjdskl @.***> wrote:

你好请问解决了吗

— Reply to this email directly, view it on GitHub https://github.com/yerfor/GeneFacePlusPlus/issues/129#issuecomment-2008553767, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADE4GRK25PLKATQ5HP47CITYZDTQNAVCNFSM6AAAAABEXYFFASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBYGU2TGNZWG4 . You are receiving this because you authored the thread.Message ID: @.***>

-- Best Regards

Davis

liangxx29 avatar Mar 20 '24 04:03 liangxx29

非常感谢,已经解决啦

fjesikfjdskl avatar Mar 20 '24 06:03 fjesikfjdskl

咋解决的,能共享下不

AspadaX avatar Mar 27 '24 03:03 AspadaX

想问下是如何解决的呢

abinggo avatar Apr 23 '24 06:04 abinggo

非常感谢,已经解决啦

想问下是怎么解决的呢

abinggo avatar Apr 23 '24 06:04 abinggo

egs配置文件中数据的维度修改为相同

fjesikfjdskl avatar Apr 23 '24 06:04 fjesikfjdskl