kohya-ss / kohya-ss/sd-scripts

Error just before learning (Using Locon)

Open
#263 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.2k
Avg merge
11m
Merged PRs (30d)
2

Description

LoConを使って学習をさせているのですが、以下のエラーが出ます。
I am using LoCon to learn, but I get the following error.

running training / 学習開始
num train images * repeats / 学習画像の数×繰り返し回数: 300
num reg images / 正則化画像の数: 100
num batches per epoch / 1epochのバッチ数: 300
num epochs / epoch数: 10
batch size per device / バッチサイズ: 2
gradient accumulation steps / 勾配を合計するステップ数 = 1
total optimization steps / 学習ステップ数: 3000
Traceback (most recent call last):
File "sd-scripts/train_network.py", line 642, in
train(args)
File "sd-scripts/train_network.py", line 411, in train
metadata |= {
TypeError: unsupported operand type(s) for |=: 'dict' and 'dict'
Traceback (most recent call last):
File "/usr/local/bin/accelerate", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/accelerate_cli.py", line 45, in main
args.func(args)
File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 1069, in launch_command
simple_launcher(args)
File "/usr/local/lib/python3.8/dist-packages/accelerate/commands/launch.py", line 551, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3', 'sd-scripts/train_network.py', '--pretrained_model_name_or_path=JosephusCheung/ACertainty', '--train_data_dir=train', '--reg_data_dir=reg', '--network_dim=16', '--network_alpha=8', '--resolution=512', '--enable_bucket', '--output_dir=output', '--prior_loss_weight=1.0', '--train_batch_size=2', '--text_encoder_lr=1.1666666666666666e-05', '--unet_lr=7e-05', '--lr_scheduler=cosine_with_restarts', '--lr_warmup_steps=750', '--max_train_steps=3000', '--optimizer_type=Lion', '--mixed_precision=fp16', '--xformers', '--cache_latents', '--gradient_checkpointing', '--save_precision=fp16', '--save_every_n_epochs=2', '--save_model_as=safetensors', '--network_module=locon.locon_kohya', '--network_args', 'conv_dim=8', 'conv_alpha=4', '--logging_dir=logs', '--clip_skip=2']' returned non-zero exit status 1.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at sd-scripts/train_network.py line 411, where the reported TypeError occurs while training with the shown LoCon command. Reproduce the failure with that command under the reported Python 3.8 environment, inspect the surrounding metadata handling, and confirm that training proceeds past this point without the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.