kohya-ss / kohya-ss/sd-scripts

i having some truble training my model

Open
#403 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

the log:
Folder 108_Lisa : 1512 steps
max_train_steps = 1512
stop_text_encoder_training = 0
lr_warmup_steps = 0
accelerate launch --num_cpu_threads_per_process=2 "train_db.py" --enable_bucket --pretrained_model_name_or_path="runwayml/stable-diffusion-v1-5" --train_data_dir="C:\SD\process LoRa Lisa\LoRa Lisa\image" --resolution=512,512 --output_dir="C:\SD\process LoRa Lisa\LoRa Lisa\model" --logging_dir="C:\SD\process LoRa Lisa\LoRa Lisa\log" --save_model_as=ckpt --output_name="Sexy Lisa" --max_data_loader_n_workers="1" --learning_rate="0.0001" --lr_scheduler="constant" --train_batch_size="1" --max_train_steps="1512" --save_every_n_epochs="1" --mixed_precision="fp16" --save_precision="fp16" --seed="1234" --caption_extension=".txt" --cache_latents --optimizer_type="AdamW" --max_data_loader_n_workers="1" --clip_skip=2 --bucket_reso_steps=64 --mem_eff_attn --gradient_checkpointing --xformers --bucket_no_upscale
prepare tokenizer
prepare images.
found directory C:\SD\process LoRa Lisa\LoRa Lisa\image\108_Lisa contains 14 image files
1512 train images with repeating.
0 reg images.
no regularization images / 正則化画像が見つかりませんでした
[Dataset 0]
batch_size: 1
resolution: (512, 512)
enable_bucket: True
min_bucket_reso: 256
max_bucket_reso: 1024
bucket_reso_steps: 64
bucket_no_upscale: True

[Subset 0 of Dataset 0]
image_dir: "C:\SD\process LoRa Lisa\LoRa Lisa\image\108_Lisa"
image_count: 14
num_repeats: 108
shuffle_caption: False
keep_tokens: 0
caption_dropout_rate: 0.0
caption_dropout_every_n_epoches: 0
caption_tag_dropout_rate: 0.0
color_aug: False
flip_aug: False
face_crop_aug_range: None
random_crop: False
token_warmup_min: 1,
token_warmup_step: 0,
is_reg: False
class_tokens: Lisa
caption_extension: .txt

[Dataset 0]
loading image sizes.
100%|████████████████████████████████████████████████████████████████████████████████| 14/14 [00:00<00:00, 1749.97it/s]
make buckets
min_bucket_reso and max_bucket_reso are ignored if bucket_no_upscale is set, because bucket reso is defined by image size automatically / bucket_no_upscaleが指定された場合は、bucketの解像度は画像サイズから自動計算されるため、min_bucket_resoとmax_bucket_resoは無視されます
number of images (including repeats) / 各bucketの画像枚数(繰り返し回数を含む)
bucket 0: resolution (384, 576), count: 216
bucket 1: resolution (384, 640), count: 432
bucket 2: resolution (448, 384), count: 108
bucket 3: resolution (448, 448), count: 108
bucket 4: resolution (448, 512), count: 108
bucket 5: resolution (640, 384), count: 540
mean ar error (without repeats): 0.07950887263541806
prepare accelerator
Using accelerator 0.15.0 or above.
load Diffusers pretrained models
safety_checker\model.safetensors not found
Fetching 19 files: 16%|██████████ | 3/19 [01:04<05:42, 21.43s/it]
Downloading pytorch_model.bin: 5%|██▍ | 62.9M/1.22G [00:52<17:24, 1.10MB/s]model is not found as a file or in Hugging Face, perhaps file name is wrong? / 指定したモデル名のファイル、またはHugging Faceのモデルが見つかりません。ファイル名が誤っているかもしれません: runwayml/stable-diffusion-v1-501:08<57:52, 975kB/s]
Downloading model.safetensors: 3%|█▌ | 41.9M/1.22G [01:20<37:38, 520kB/s]
Downloading pytorch_model.bin: 5%|██▍ | 62.9M/1.22G [01:20<24:38, 780kB/s]
Downloading model.safetensors: 6%|███ | 31.5M/492M [01:20<19:41, 390kB/s]
Downloading pytorch_model.bin: 11%|█████ | 52.4M/492M [01:20<11:16, 650kB/s]
Downloading (…)on_pytorch_model.bin: 2%|▌ | 52.4M/3.44G [01:20<1:26:51, 650kB/s]
Downloading (…)ch_model.safetensors: 2%|▉ | 83.9M/3.44G [01:20<53:46, 1.04MB/s]
Downloading (…)on_pytorch_model.bin: 41%|█████████████████ | 136M/335M [01:19<01:56, 1.71MB/s]
Downloading (…)ch_model.safetensors: 9%|███▉ | 31.5M/335M [01:20<12:57, 390kB/s]
Traceback (most recent call last):
File "C:\SD\Kohya\kohya_ss\train_db.py", line 427, in
train(args)
File "C:\SD\Kohya\kohya_ss\train_db.py", line 95, in train
text_encoder, vae, unet, load_stable_diffusion_format = train_util.load_target_model(args, weight_dtype)
File "C:\SD\Kohya\kohya_ss\library\train_util.py", line 2749, in load_target_model
text_encoder = pipe.text_encoder
UnboundLocalError: local variable 'pipe' referenced before assignment
Traceback (most recent call last):
File "C:\Users\waki-\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\waki-\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\SD\Kohya\kohya_ss\venv\Scripts\accelerate.exe\__main__.py", line 7, in
File "C:\SD\Kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main
args.func(args)
File "C:\SD\Kohya\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command
simple_launcher(args)
File "C:\SD\Kohya\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:\\SD\\Kohya\\kohya_ss\\venv\\Scripts\\python.exe', 'train_db.py', '--enable_bucket', '--pretrained_model_name_or_path=runwayml/stable-diffusion-v1-5', '--train_data_dir=C:\\SD\\process LoRa Lisa\\LoRa Lisa\\image', '--resolution=512,512', '--output_dir=C:\\SD\\process LoRa Lisa\\LoRa Lisa\\model', '--logging_dir=C:\\SD\\process LoRa Lisa\\LoRa Lisa\\log', '--save_model_as=ckpt', '--output_name=Sexy Lisa', '--max_data_loader_n_workers=1', '--learning_rate=0.0001', '--lr_scheduler=constant', '--train_batch_size=1', '--max_train_steps=1512', '--save_every_n_epochs=1', '--mixed_precision=fp16', '--save_precision=fp16', '--seed=1234', '--caption_extension=.txt', '--cache_latents', '--optimizer_type=AdamW', '--max_data_loader_n_workers=1', '--clip_skip=2', '--bucket_reso_steps=64', '--mem_eff_attn', '--gradient_checkpointing', '--xformers', '--bucket_no_upscale']' returned non-zero exit status 1.

if you any clue help plzz

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with train_db.py at line 95 and library/train_util.py at line 2749, using the logged accelerate command and model-loading output. Trace why the model-loading path reaches the unbound pipe error, then reproduce it with the supplied configuration. Done means the failure is explained and the model-loading error is handled or documented clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.