derrian-distro / LoRA_Easy_Training_Scripts

A UI made in Pyside6 to make training LoRA/LoCon and other LoRA type models in sd-scripts easy
GNU General Public License v3.0
1.07k stars 104 forks source link

Error using kohya-ss script #17

Closed VantomPayne closed 1 year ago

VantomPayne commented 1 year ago

I keep running into errors when trying to train Lora using the kohya-ss gui version, trying to check if there are any issues from the other repos but could not find any.

number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む) bucket 0: resolution (512, 960), count: 100 bucket 1: resolution (512, 1024), count: 100 bucket 2: resolution (512, 1088), count: 100 bucket 3: resolution (576, 832), count: 200 bucket 4: resolution (576, 896), count: 2500 bucket 5: resolution (576, 960), count: 200 bucket 6: resolution (576, 1024), count: 500 bucket 7: resolution (640, 768), count: 100 bucket 8: resolution (640, 832), count: 300 bucket 9: resolution (704, 704), count: 100 bucket 10: resolution (704, 832), count: 100 bucket 11: resolution (768, 768), count: 200 bucket 12: resolution (832, 576), count: 500 bucket 13: resolution (832, 640), count: 100 bucket 14: resolution (896, 576), count: 200 mean ar error (without repeats): 0.02307973702553633 prepare accelerator Using accelerator 0.15.0 or above. load StableDiffusion checkpoint loading u-net: loading vae: Traceback (most recent call last): File "F:\StableDiffusion\kohya_ss\venv\lib\site-packages\transformers\modeling_utils.py", line 415, in load_state_dict return torch.load(checkpoint_file, map_location="cpu") File "F:\StableDiffusion\kohya_ss\venv\lib\site-packages\torch\serialization.py", line 705, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "F:\StableDiffusion\kohya_ss\venv\lib\site-packages\torch\serialization.py", line 242, in init super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer)) RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "F:\StableDiffusion\kohya_ss\venv\lib\site-packages\transformers\modeling_utils.py", line 419, in load_state_dict if f.read(7) == "version": UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 64: illegal multibyte sequence

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "F:\StableDiffusion\kohya_ss\train_network.py", line 586, in train(args) File "F:\StableDiffusion\kohya_ss\train_network.py", line 158, in train textencoder, vae, unet, = train_util.load_target_model(args, weight_dtype) File "F:\StableDiffusion\kohya_ss\library\train_util.py", line 1598, in load_target_model text_encoder, vae, unet = model_util.load_models_from_stable_diffusion_checkpoint(args.v2, args.pretrained_model_name_or_path) File "F:\StableDiffusion\kohya_ss\library\model_util.py", line 919, in load_models_from_stable_diffusion_checkpoint text_model = CLIPTextModel.from_pretrained("openai/clip-vit-large-patch14") File "F:\StableDiffusion\kohya_ss\venv\lib\site-packages\transformers\modeling_utils.py", line 2301, in from_pretrained state_dict = load_state_dict(resolved_archive_file) File "F:\StableDiffusion\kohya_ss\venv\lib\site-packages\transformers\modeling_utils.py", line 431, in load_state_dict raise OSError( OSError: Unable to load weights from pytorch checkpoint file for 'C:\Users\admin/.cache\huggingface\hub\models--openai--clip-vit-large-patch14\snapshots\8d052a0f05efbaefbc9e8786ba291cfdf93e5bff\pytorch_model.bin' at 'C:\Users\admin/.cache\huggingface\hub\models--openai--clip-vit-large-patch14\snapshots\8d052a0f05efbaefbc9e8786ba291cfdf93e5bff\pytorch_model.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True. Traceback (most recent call last): File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "F:\StableDiffusion\kohya_ss\venv\Scripts\accelerate.exe__main__.py", line 7, in File "F:\StableDiffusion\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main args.func(args) File "F:\StableDiffusion\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command simple_launcher(args) File "F:\StableDiffusion\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 567, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['F:\StableDiffusion\kohya_ss\venv\Scripts\python.exe', 'train_network.py', '--enable_bucket', '--pretrained_model_name_or_path=F:/stable-diffusion-webui/models/Stable-diffusion/chilloutmix_NiPrunedFp32Fix.safetensors', '--train_data_dir=F:/StableDiffusion/kohya_ss/Output/img', '--resolution=768,768', '--output_dir=F:/StableDiffusion/kohya_ss/Output/model', '--logging_dir=F:/StableDiffusion/kohya_ss/Output/log', '--network_alpha=1', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=5e-5', '--unet_lr=0.0001', '--network_dim=8', '--output_name=Miiko-v1', '--lr_scheduler_num_cycles=4', '--learning_rate=0.0001', '--lr_scheduler=cosine', '--lr_warmup_steps=707', '--train_batch_size=3', '--max_train_steps=7067', '--save_every_n_epochs=1', '--mixed_precision=fp16', '--save_precision=fp16', '--seed=1234', '--cache_latents', '--bucket_reso_steps=64', '--xformers', '--use_8bit_adam', '--bucket_no_upscale']' returned non-zero exit status 1.

boeor01 commented 1 year ago

seems to have been introduced with the earliest february 20th commit

derrian-distro commented 1 year ago

this error doesn't look like something that is related to my scripts, as I don't maintain kohya_ss, I suggest you open up an issue over there, as I can't really help with this.