open-mmlab / PIA

[CVPR 2024] PIA, your Personalized Image Animator. Animate your images by text prompt, combing with Dreambooth, achieving stunning videos. PIA,你的个性化图像动画生成器,利用文本提示将图像变为奇妙的动画
https://pi-animator.github.io/
Apache License 2.0
808 stars 67 forks source link

Unexpected key(s) in state_dict: "text_model.embeddings.position_ids". #13

Open anthonyyuan opened 6 months ago

anthonyyuan commented 6 months ago

validation_pipeline = I2VPipeline.build_pipeline( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/anthony/work/third/stable-diffusion-good/sd2/PIA/animatediff/pipelines/i2v_pipeline.py", line 228, in build_pipeline text_encoder.load_state_dict(text_encoder_checkpoint) File "/home/anthony/miniconda3/envs/p12/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for CLIPTextModel: Unexpected key(s) in state_dict: "text_model.embeddings.position_ids".

LeoXing1996 commented 6 months ago

@anthonyyuan Thank you for your interest in this project. This error appears to be caused by a mismatched transformers version. We recommend using transformers==4.25.1 for PIA. You can check your transformers version by pip list | grep transformers or conda list transformers.

johndpope commented 6 months ago

make sure in the Lora drop down - you're not incorrectly selecting a model or just leave blank.

DannHuang commented 4 months ago

Same issue when using kohya_ss repo, simply remove the unexpected key from state dictionary, with 'del text_encoder_checkpoint["text_model.embeddings.position_ids"]' in your case, works for me