KwaiVGI / LivePortrait

Bring portraits to life!
https://liveportrait.github.io
Other
11.73k stars 1.22k forks source link

macos m3笔记本 UnpicklingError: invalid load key, 'v'. #232

Open lm2024 opened 1 month ago

lm2024 commented 1 month ago

(LivePortrait39) ➜ LivePortrait git:(main) PYTORCH_ENABLE_MPS_FALLBACK=1 python inference.py Traceback (most recent call last): File "/Users/zhanglimin/Documents/ideaProject/ai/LivePortrait/LivePortrait/inference.py", line 62, in main() File "/Users/zhanglimin/Documents/ideaProject/ai/LivePortrait/LivePortrait/inference.py", line 52, in main live_portrait_pipeline = LivePortraitPipeline( File "/Users/zhanglimin/Documents/ideaProject/ai/LivePortrait/LivePortrait/src/live_portrait_pipeline.py", line 38, in init self.live_portrait_wrapper: LivePortraitWrapper = LivePortraitWrapper(inference_cfg=inference_cfg) File "/Users/zhanglimin/Documents/ideaProject/ai/LivePortrait/LivePortrait/src/live_portrait_wrapper.py", line 39, in init self.appearance_feature_extractor = load_model(inference_cfg.checkpoint_F, model_config, self.device, 'appearance_feature_extractor') File "/Users/zhanglimin/Documents/ideaProject/ai/LivePortrait/LivePortrait/src/utils/helper.py", line 144, in load_model model.load_state_dict(torch.load(ckpt_path, map_location=lambda storage, loc: storage)) File "/opt/miniconda3/envs/LivePortrait39/lib/python3.9/site-packages/torch/serialization.py", line 1040, in load return _legacy_load(opened_file, map_location, pickle_module, pickle_load_args) File "/opt/miniconda3/envs/LivePortrait39/lib/python3.9/site-packages/torch/serialization.py", line 1262, in _legacy_load magic_number = pickle_module.load(f, pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.

lm2024 commented 1 month ago

这种情况怎么办? 我无法继续执行了? 上面的其他步骤我都按要求执行过了。

zzzweakman commented 1 month ago

这种情况怎么办? 我无法继续执行了? 上面的其他步骤我都按要求执行过了。

您好,您可以确认一下模型被正确下载到对应的路径了吗?以及他是否和我们readme中给出的模型文件大小一致?这有可能是文件损坏导致的。

Thank you for your attention! Could you confirm that all the weights are placed in the correct location and that their sizes match those indicated in the table in the readme? @lm2024