kohya-ss / sd-scripts

Apache License 2.0
5.13k stars 855 forks source link

Issue to merge Lora #1025

Closed Aurety closed 9 months ago

Aurety commented 9 months ago

Hello, I can't merge Lora to SDXL Models since the last update.. I have the same error and can't find anything to understand what is wrong now.. Any clue ?

13:28:32-987788 INFO Version: v22.3.1

13:28:32-996765 INFO nVidia toolkit detected 13:28:45-015272 INFO Torch 2.0.1+cu118 13:28:45-125265 INFO Torch backend: nVidia CUDA 11.8 cuDNN 8700 13:28:45-128302 INFO Torch detected GPU: NVIDIA GeForce RTX 2080 Ti VRAM 11264 Arch (7, 5) Cores 68 13:28:45-130270 INFO Verifying modules installation status from requirements_windows_torch2.txt... 13:28:45-146330 INFO Verifying modules installation status from requirements.txt... 13:28:55-881137 INFO headless: False 13:28:55-978507 INFO Load CSS... Running on local URL: http://127.0.0.1:7861

To create a public link, set share=True in launch().

09:18:59-218199 INFO ./venv/Scripts/python.exe "networks\sdxl_merge_lora.py" --sd_model "G:/Automatic_1111/stable-diffusion-webui/models/Stable-diffusion/_GGG_V1.9_111_08.fp16.safe tensors" --save_precision fp16 --precision float --save_to "G:/Automatic_1111/stable-diffusion-webui/models/Stable-diffusion/_GGG_V1.9_111_11.fp16.safe tensors" --models "G:/Automatic_1111/stable-diffusion-webui/models/Lora/Directors_Artists/Director Coen Brothers style.safetensors" "G:/Automatic_1111/stable-diffusion-webui/models/Lora/Directors_Artists/Director Stanley Kubrick style.safetensors" "G:/Automatic_1111/stable-diffusion-webui/models/Lora/ashley_rogers_model.safetensors" "G:/Automatic_1111/stable-diffusion-webui/models/Lora/avl.safetensors" --ratios 0.34 0.4 0.35 0.16 loading SD model: G:/Automatic_1111/stable-diffusion-webui/models/Stable-diffusion/_GGG_V1.9_111_08.fp16.safetensors building U-Net loading U-Net from checkpoint U-Net: building text encoders loading text encoders from checkpoint text encoder 1: Traceback (most recent call last): File "G:\KohyaSS\kohya_ss\networks\sdxl_merge_lora.py", line 348, in merge(args) File "G:\KohyaSS\kohya_ss\networks\sdxl_merge_lora.py", line 255, in merge ) = sdxl_model_util.load_models_from_sdxl_checkpoint(sdxl_model_util.MODEL_VERSION_SDXL_BASE_V1_0, args.sd_model, "cpu") File "G:\KohyaSS\kohya_ss\library\sdxl_model_util.py", line 270, in load_models_from_sdxl_checkpoint info2 = _load_state_dict_on_device(text_model2, converted_sd, device=map_location) # remain fp32 File "G:\KohyaSS\kohya_ss\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 CLIPTextModelWithProjection: Unexpected key(s) in state_dict: "text_projection.weight.weight".

Aurety commented 9 months ago

resolved with "git pull" this day.. Sorry for that..