KwaiVGI / LivePortrait

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

ubuntu 24 start fail 2080ti 22g UnpicklingError: invalid load key, 'v'. #224

Open lonrencn opened 1 month ago

lonrencn commented 1 month ago

python inference.py /mnt/disk240/LivePortrait/src/utils/helper.py:144: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. model.load_state_dict(torch.load(ckpt_path, map_location=lambda storage, loc: storage)) Traceback (most recent call last): File "/mnt/disk240/LivePortrait/inference.py", line 57, in main() File "/mnt/disk240/LivePortrait/inference.py", line 47, in main live_portrait_pipeline = LivePortraitPipeline( File "/mnt/disk240/LivePortrait/src/live_portrait_pipeline.py", line 38, in init self.live_portrait_wrapper: LivePortraitWrapper = LivePortraitWrapper(inference_cfg=inference_cfg) File "/mnt/disk240/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 "/mnt/disk240/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 "/home/lonren/miniconda3/envs/LivePortrait/lib/python3.9/site-packages/torch/serialization.py", line 1114, in load return _legacy_load( File "/home/lonren/miniconda3/envs/LivePortrait/lib/python3.9/site-packages/torch/serialization.py", line 1338, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) _pickle.UnpicklingError: invalid load key, 'v'.

aihacker111 commented 1 month ago

That’s mean your path to pretrained model is not correctly , please check your path again

FurkanGozukara commented 1 month ago

works great on ubuntu with python 3.10

you can see in this tutorial and check that vm to install same libraries : https://youtu.be/wG7oPp01COg

i think your issue is python library depended

zzzweakman commented 1 month ago

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? @lonrencn

lonrencn commented 1 month ago

OK