You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".
The text was updated successfully, but these errors were encountered:
@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.
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
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".
The text was updated successfully, but these errors were encountered: