kohya_ss icon indicating copy to clipboard operation
kohya_ss copied to clipboard

I get an error for trian lora

Open zxc8976 opened this issue 2 years ago • 2 comments

Can someone help me.

MY PC: RTX 3080ti+WIN111 Python 3.10.9

Load CSS... Running on local URL: http://127.0.0.1:7860

To create a public link, set share=True in launch(). Loading config... Folder 150_s95175389: 1350 steps max_train_steps = 675 stop_text_encoder_training = 0 lr_warmup_steps = 0 accelerate launch --num_cpu_threads_per_process=2 "train_network.py" --pretrained_model_name_or_path="C:/Users/User/Desktop/Ai/japaneseDollLikeness_v10.safetensors" --train_data_dir="C:/Users/User/Desktop/Ai/image" --resolution=512,512 --output_dir="C:/Users/User/Desktop/Ai" --logging_dir="C:/Users/User/Desktop/Ai/log" --network_alpha="128" --save_model_as=safetensors --network_module=networks.lora --text_encoder_lr=5e-5 --unet_lr=0.0001 --network_dim=128 --output_name="Addams" --lr_scheduler_num_cycles="1" --learning_rate="0.0001" --lr_scheduler="constant" --train_batch_size="2" --max_train_steps="675" --save_every_n_epochs="1" --mixed_precision="bf16" --save_precision="bf16" --seed="1234" --caption_extension=".txt" --cache_latents --max_data_loader_n_workers="1" --clip_skip=2 --bucket_reso_steps=64 --xformers --use_8bit_adam --bucket_no_upscale prepare tokenizer Use DreamBooth method. prepare train images. found directory 150_s95175389 contains 9 image files 1350 train images with repeating. loading image sizes. 100%|██████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 1285.50it/s] prepare dataset prepare accelerator Using accelerator 0.15.0 or above. load StableDiffusion checkpoint Traceback (most recent call last): File "C:\Users\User\kohya_ss\train_network.py", line 573, in train(args) File "C:\Users\User\kohya_ss\train_network.py", line 158, in train text_encoder, vae, unet, _ = train_util.load_target_model(args, weight_dtype) File "C:\Users\User\kohya_ss\library\train_util.py", line 1594, 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 "C:\Users\User\kohya_ss\library\model_util.py", line 877, in load_models_from_stable_diffusion_checkpoint converted_unet_checkpoint = convert_ldm_unet_checkpoint(v2, state_dict, unet_config) File "C:\Users\User\kohya_ss\library\model_util.py", line 234, in convert_ldm_unet_checkpoint new_checkpoint["time_embedding.linear_1.weight"] = unet_state_dict["time_embed.0.weight"] KeyError: 'time_embed.0.weight' Traceback (most recent call last): File "C:\Users\User\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\User\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\Users\User\kohya_ss\venv\Scripts\accelerate.exe_main.py", line 7, in File "C:\Users\User\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main args.func(args) File "C:\Users\User\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command simple_launcher(args) File "C:\Users\User\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 '['C:\Users\User\kohya_ss\venv\Scripts\python.exe', 'train_network.py', '--pretrained_model_name_or_path=C:/Users/User/Desktop/Ai/japaneseDollLikeness_v10.safetensors', '--train_data_dir=C:/Users/User/Desktop/Ai/image', '--resolution=512,512', '--output_dir=C:/Users/User/Desktop/Ai', '--logging_dir=C:/Users/User/Desktop/Ai/log', '--network_alpha=128', '--save_model_as=safetensors', '--network_module=networks.lora', '--text_encoder_lr=5e-5', '--unet_lr=0.0001', '--network_dim=128', '--output_name=Addams', '--lr_scheduler_num_cycles=1', '--learning_rate=0.0001', '--lr_scheduler=constant', '--train_batch_size=2', '--max_train_steps=675', '--save_every_n_epochs=1', '--mixed_precision=bf16', '--save_precision=bf16', '--seed=1234', '--caption_extension=.txt', '--cache_latents', '--max_data_loader_n_workers=1', '--clip_skip=2', '--bucket_reso_steps=64', '--xformers', '--use_8bit_adam', '--bucket_no_upscale']' returned non-zero exit status 1.

zxc8976 avatar Feb 18 '23 13:02 zxc8976

I got the same error.

It seems to "--pretrained_model_name_or_path" needs to be set CHECKPOINT file. (and pay attention to the version of pretrained model is based on.) "japaneseDollLikeness_v10.safetensors" is LORA file.

see here. image

I dont know how to use LORA file yet. i will study from now.

morig avatar Feb 23 '23 15:02 morig

I recommend checking out the video below at the timestamp and learning about the settings, double check you have the right folder structure setup as well as the correct checkpoint selected. - https://youtu.be/7m522D01mh0?list=LL&t=1098 GL!

SaltySkegg avatar Feb 24 '23 21:02 SaltySkegg