您好,如题,原始模型是从huggingface上直接下载的,我在taiyi_xl_minimal_inference.py中修改了加载的位置
`
# todo
args.ckpt_path = "/Volumes/Taiyi-Stable-Diffusion-XL-3.5B/taiyi_diffusion_xl.safetensors"
# todo
# HuggingFaceのmodel id
PRETRAINED_MODEL_DIR = "/Volumes/Taiyi-Stable-Diffusion-XL-3.5B"
text_encoder_1_name = f"{PRETRAINED_MODEL_DIR}/tokenizer"
text_encoder_2_name = f"{PRETRAINED_MODEL_DIR}/tokenizer_2"
`
推理的log如下
`
(sd) ➜ Taiyi-Diffusion-XL git:(debug) ✗ python taiyi_xl_minimal_inference.py
building U-Net
loading U-Net from checkpoint
U-Net:
building text encoders
使用taiyi模型微调!
loading text encoders from checkpoint
Traceback (most recent call last):
File "/Users/codes/Taiyi-Diffusion-XL/taiyi_xl_minimal_inference.py", line 267, in
text_model1, text_model2, vae, unet, _, _ = sdxl_model_util.load_models_from_sdxl_checkpoint(
File "/Users/codes/Taiyi-Diffusion-XL/library/sdxl_model_util.py", line 275, in load_models_from_sdxl_checkpoint
info1 = _load_state_dict_on_device(text_model1, te1_sd, device=map_location) # remain fp32
File "/Users/codes/Taiyi-Diffusion-XL/library/sdxl_model_util.py", line 158, in _load_state_dict_on_device
raise RuntimeError("Error(s) in loading state_dict for {}:\n\t{}".format(model.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for CLIPTextModel:
Unexpected key(s) in state_dict: "text_model.embeddings.position_ids".
`
您好,如题,原始模型是从huggingface上直接下载的,我在taiyi_xl_minimal_inference.py中修改了加载的位置
`
`
推理的log如下
`
(sd) ➜ Taiyi-Diffusion-XL git:(debug) ✗ python taiyi_xl_minimal_inference.py
building U-Net
loading U-Net from checkpoint
U-Net:
building text encoders
使用taiyi模型微调!
loading text encoders from checkpoint
Traceback (most recent call last):
File "/Users/codes/Taiyi-Diffusion-XL/taiyi_xl_minimal_inference.py", line 267, in
text_model1, text_model2, vae, unet, _, _ = sdxl_model_util.load_models_from_sdxl_checkpoint(
File "/Users/codes/Taiyi-Diffusion-XL/library/sdxl_model_util.py", line 275, in load_models_from_sdxl_checkpoint
info1 = _load_state_dict_on_device(text_model1, te1_sd, device=map_location) # remain fp32
File "/Users/codes/Taiyi-Diffusion-XL/library/sdxl_model_util.py", line 158, in _load_state_dict_on_device
raise RuntimeError("Error(s) in loading state_dict for {}:\n\t{}".format(model.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for CLIPTextModel:
Unexpected key(s) in state_dict: "text_model.embeddings.position_ids".
`