训练时 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format 求指导
训练 python tasks/run.py --config=egs/datasets/x6/lm3d_radnerf_sr.yaml --exp_name=motion2video_nerf/may_head --reset
Traceback (most recent call last): File "D:\GeneFacePlusPlus_py39\utils\commons\trainer.py", line 151, in fit self.run_single_process(self.task) File "D:\GeneFacePlusPlus_py39\utils\commons\trainer.py", line 209, in run_single_process self.restore_weights(checkpoint) File "D:\GeneFacePlusPlus_py39\utils\commons\trainer.py", line 476, in restore_weights getattr(task_ref, k).load_state_dict(v, strict=True) File "D:\GeneFacePlusPlus_py39\python\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 RADNeRFwithSR: 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]). 'pkill' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 Traceback (most recent call last): File "D:\GeneFacePlusPlus_py39\utils\commons\trainer.py", line 151, in fit self.run_single_process(self.task) File "D:\GeneFacePlusPlus_py39\utils\commons\trainer.py", line 209, in run_single_process self.restore_weights(checkpoint) File "D:\GeneFacePlusPlus_py39\utils\commons\trainer.py", line 476, in restore_weights getattr(task_ref, k).load_state_dict(v, strict=True) File "D:\GeneFacePlusPlus_py39\python\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 RADNeRFwithSR: 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]).
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\GeneFacePlusPlus_py39\tasks\run.py", line 28, in
我的环境: WIN10 python39 torch2.0.1
卡在这里过不去了,求指导
我也是这个问题,我采用不严格匹配的方式,具体的方法可以参考我的git
应该是eye_blink_dim设置问题,找到egs\datasets\May\lm3d_radnerf_sr.yaml修改如下
eye_blink_dim: 8 https://github.com/yerfor/GeneFacePlusPlus/pull/2 把2改为8,就ok; 其实不用它原来的checkpoints是不存在这个问题的
十分感谢,谢谢你,我这就去试试,你真棒