kohya-ss / kohya-ss/sd-scripts
学習させてもsafetensorデータが生成されない
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.2k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
どうか皆様のお力をお借りできればと思い、質問させていただきました。どうかお願い致します。
loraの作成時に数KBのTOML・JSONファイルが作られるのみでsafetensorファイルが作成されません。またtrain stepsも0%まま一切進まない原因が分かりません。以下の内容に何かエラーが起きているのでしょうか。学習用モデルもSDXLでしか画像の読み込みがされませんでした。学習用の画像は一度リサイズしました。
グラボはrtx5050 16gbを使用しております。是非ともよろしくお願いいたします。
00:36:26-311331 INFO Training has ended.
00:37:38-060680 INFO Start training LoRA Standard ...
00:37:38-060680 INFO Validating lr scheduler arguments...
00:37:38-061680 INFO Validating optimizer arguments...
00:37:38-061680 INFO Validating
M:/StabilityMatrix-win-x64/Data/Packages/kohya_ss/outp
uts existence and writability... SUCCESS
00:37:38-062680 INFO Validating
M:/StabilityMatrix-win-x64/Data/Models/StableDiffusion
/sd_xl_base_1.0_0.9vae.safetensors existence...
SUCCESS
00:37:38-063681 INFO Validating
M:/StabilityMatrix-win-x64/Data/Packages/train/nisimur
a existence... SUCCESS
00:37:38-064680 INFO Folder 10_nisimura: 10 repeats found
00:37:38-065681 INFO Folder 10_nisimura: 78 images found
00:37:38-066680 INFO Folder 10_nisimura: 78 * 10 = 780 steps
00:37:38-066680 INFO Regularization factor: 1
00:37:38-067680 INFO Train batch size: 1
00:37:38-067680 INFO Gradient accumulation steps: 1
00:37:38-068680 INFO Epoch: 2
00:37:38-068680 INFO Max train steps: 1000
00:37:38-069680 INFO stop_text_encoder_training = 0
00:37:38-069680 INFO lr_warmup_steps = 0.1
00:37:38-070680 INFO Effective Learning Rate Configuration (based on GUI
settings):
00:37:38-071680 INFO - Main LR (for optimizer & fallback): 1.00e-04
00:37:38-071680 INFO - Text Encoder (Primary/CLIP) Effective LR: 1.00e-04
(Fallback to Main LR)
00:37:38-072679 INFO - Text Encoder (T5XXL, if applicable) Effective LR:
1.00e-04 (Fallback to Main LR)
00:37:38-073680 INFO - U-Net Effective LR: 1.00e-04 (Specific Value)
00:37:38-073680 INFO Note: These LRs reflect the GUI's direct settings.
Advanced options in sd-scripts (e.g., block LRs,
LoRA+) can further modify rates for specific layers.
00:37:38-074680 INFO Saving training config to
M:/StabilityMatrix-win-x64/Data/Packages/kohya_ss/outp
uts\nishimura_v1_20251106-003738.json...
00:37:38-075680 INFO Executing command:
M:\StabilityMatrix-win-x64\Data\Packages\kohya_ss\venv
\Scripts\accelerate.EXE launch --dynamo_backend no
--dynamo_mode default --mixed_precision bf16
--num_processes 1 --num_machines 1
--num_cpu_threads_per_process 2
M:/StabilityMatrix-win-x64/Data/Packages/kohya_ss/sd-s
cripts/sdxl_train_network.py --config_file
M:/StabilityMatrix-win-x64/Data/Packages/kohya_ss/outp
uts/config_lora-20251106-003738.toml
2025-11-06 00:37:46 INFO Loading settings from train_util.py:4651
M:/StabilityMatrix-win-x64/Data
/Packages/kohya_ss/outputs/conf
ig_lora-20251106-003738.toml...
M:\StabilityMatrix-win-x64\Data\Packages\kohya_ss\venv\lib\site-packages\transformers\tokenization_utils_base.py:1601: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884
warnings.warn(
2025-11-06 00:37:46 INFO Using DreamBooth method. train_network.py:517
INFO prepare images. train_util.py:2072
INFO get image size from name of train_util.py:1965
cache files
100%|██████████| 78/78 [00:00
INFO building text encoders sdxl_model_util.py:211
INFO loading text encoders from sdxl_model_util.py:264
checkpoint
INFO text encoder 1:
INFO text encoder 2:
INFO building VAE sdxl_model_util.py:285
2025-11-06 00:37:49 INFO loading VAE from checkpoint sdxl_model_util.py:290
INFO VAE:
INFO Enable xformers for U-Net train_util.py:3349
import network module: networks.lora
INFO [Dataset 0] train_util.py:2613
INFO caching latents with caching train_util.py:1115
strategy.
INFO caching latents... train_util.py:1164
100%|██████████| 78/78 [00:22<00:00, 3.46it/s]
2025-11-06 00:38:12 INFO create LoRA network. base dim (rank): lora.py:935
64, alpha: 32
INFO neuron dropout: p=None, rank dropout: lora.py:936
p=None, module dropout: p=None
INFO create LoRA for Text Encoder 1: lora.py:1027
INFO create LoRA for Text Encoder 2: lora.py:1027
INFO create LoRA for Text Encoder: 264 lora.py:1035
modules.
2025-11-06 00:38:13 INFO create LoRA for U-Net: 722 modules. lora.py:1043
INFO enable LoRA for U-Net: 722 modules lora.py:1089
prepare optimizer, data loader etc.
INFO use 8-bit AdamW optimizer | {} train_util.py:4804
running training / 学習開始
num train images * repeats / 学習画像の数×繰り返し回数: 780
num validation images * repeats / 学習画像の数×繰り返し回数: 0
num reg images / 正則化画像の数: 0
num batches per epoch / 1epochのバッチ数: 780
num epochs / epoch数: 2
batch size per device / バッチサイズ: 1
gradient accumulation steps / 勾配を合計するステップ数 = 1
total optimization steps / 学習ステップ数: 1000
2025-11-06 00:38:19 INFO unet dtype: torch.bfloat16, train_network.py:1323
device: cuda:0
INFO text_encoder [0] dtype: train_network.py:1329
torch.bfloat16, device:
cuda:0
INFO text_encoder [1] dtype: train_network.py:1329
torch.bfloat16, device:
cuda:0
steps: 0%| | 0/1000 [00:00
sys.exit(main())
File "M:\StabilityMatrix-win-x64\Data\Packages\kohya_ss\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 50, in main
args.func(args)
File "M:\StabilityMatrix-win-x64\Data\Packages\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 1235, in launch_command
simple_launcher(args)
File "M:\StabilityMatrix-win-x64\Data\Packages\kohya_ss\venv\lib\site-packages\accelerate\commands\launch.py", line 823, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['M:\\StabilityMatrix-win-x64\\Data\\Packages\\kohya_ss\\venv\\Scripts\\python.exe', 'M:/StabilityMatrix-win-x64/Data/Packages/kohya_ss/sd-scripts/sdxl_train_network.py', '--config_file', 'M:/StabilityMatrix-win-x64/Data/Packages/kohya_ss/outputs/config_lora-20251106-003738.toml']' returned non-zero exit status 1.
00:38:22-446854 INFO Training has ended.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the logged entry point sdxl_train_network.py and follow its calls into train_network.py and train_util.py; the log currently ends while loading the Stable Diffusion checkpoint. Reproduce the command using the saved TOML configuration and determine why training does not progress or produce a safetensors file; done means the run completes and the expected output file is created.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100