kohya-ss / kohya-ss/sd-scripts

Low loss but bad results, what am I doing wrong?

Open
#163 3 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

After training TI for 1500 steps, I can get down to a loss of about 0.05, much better than the previous 0.1. However, the results are still bad. Very bad. Here is what the training input params looks like:

```
/home/ubuntu/anaconda3/envs/pt13/bin/accelerate launch --num_cpu_threads_per_process 2 train_textual_inversion.py \
--pretrained_model_name_or_path="runwayml/stable-diffusion-v1-5" \
--train_data_dir="/home/ubuntu/sd-scripts/training_images/train_person/" \
--output_dir="./models" \
--resolution=512 \
--train_batch_size=1 \
--learning_rate=1e-4 \
--max_train_steps=1500 \
--save_every_n_epochs=1 \
--save_model_as="safetensors" \
--clip_skip=2 \
--seed=42 \
--color_aug \
--use_8bit_adam \
--lr_scheduler="cosine" \
--use_object_template \
--token_string="qwerty" \
--init_word="*" \
--num_vectors_per_token=8
```

Moreover, here is the last recorded training log:

`steps: 100%|███████████████████████████████████████████████████████████████| 1500/1500 [09:24<00:00, 2.66it/s, loss=0.0542]`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with train_textual_inversion.py and the supplied training command, then reproduce the 1500-step run using the stated parameters and inspect the resulting output alongside the 0.0542 loss log. The issue is resolved only when the cause of the poor results is identified and a verified training configuration or code fix is established.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.