AniPortrait icon indicating copy to clipboard operation
AniPortrait copied to clipboard

pls help to fix this

Open xiohulp opened this issue 1 year ago • 2 comments

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "D:\AniPortrait\scripts\pose2vid.py", line 210, in main() File "D:\AniPortrait\scripts\pose2vid.py", line 63, in main reference_unet = UNet2DConditionModel.from_pretrained( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AniPortrait\venv\Lib\site-packages\diffusers\models\modeling_utils.py", line 812, in from_pretrained unexpected_keys = load_model_dict_into_meta( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\AniPortrait\venv\Lib\site-packages\diffusers\models\modeling_utils.py", line 155, in load_model_dict_into_meta raise ValueError( ValueError: Cannot load ./pretrained_model/stable-diffusion-v1-5 because down_blocks.0.attentions.0.transformer_blocks.0.attn2.to_k.weight expected shape tensor(..., device='meta', size=(320, 1280)), but got torch.Size([320, 768]). If you want to instead overwrite randomly initialized weights, please make sure to pass both low_cpu_mem_usage=False and ignore_mismatched_sizes=True. For more information, see also: https://github.com/huggingface/diffusers/issues/1619#issuecomment-1345604389 as an example.

xiohulp avatar Apr 13 '24 02:04 xiohulp

Check you have the same as this here https://huggingface.co/spaces/ZJYang/AniPortrait_official/tree/main/pretrained_model

G-force78 avatar Apr 13 '24 07:04 G-force78

Check you have the same as this here https://huggingface.co/spaces/ZJYang/AniPortrait_official/tree/main/pretrained_model

Yes, please make sure the pretrained_model file is complete. And you can re-download stable-diffusion-v1-5

Zejun-Yang avatar Apr 15 '24 02:04 Zejun-Yang