sd-scripts icon indicating copy to clipboard operation
sd-scripts copied to clipboard

[Fix text_model confinement][Unexpected key(s) in state_dict]

Open tomguluson92 opened this issue 2 years ago • 5 comments

Fix Unexpected key(s) in state_dict: "text_model.embeddings.position_ids". problem aroused by loading text_model.

tomguluson92 avatar Jul 28 '23 02:07 tomguluson92

Thank you for this! But I'd like to keep strict=True to find unexpected errors. If some error occurs in loading the state dict, I will add a conversion code for it. Could you please tell me the location (url) of the checkpoint which causes the error?

kohya-ss avatar Jul 28 '23 03:07 kohya-ss

Thank you for this! But I'd like to keep strict=True to find unexpected errors. If some error occurs in loading the state dict, I will add a conversion code for it. Could you please tell me the location (url) of the checkpoint which causes the error?

Thanks, This is only for info text_model, which is not used in real training. The base model I found not compatible is civitai-awportrait

tomguluson92 avatar Jul 28 '23 05:07 tomguluson92

I've updated dev branch to support the model, and will merge into main sooner. May I close this PR?

kohya-ss avatar Jul 29 '23 05:07 kohya-ss

btw, this is also happening if using transformers any version higher than 4.30.2.

vladmandic avatar Oct 01 '23 17:10 vladmandic

When I upgraded transformers==4.36.2 this error disappeared

8-unlimit avatar Aug 05 '24 10:08 8-unlimit