derrian-distro / LoRA_Easy_Training_Scripts

A UI made in Pyside6 to make training LoRA/LoCon and other LoRA type models in sd-scripts easy
GNU General Public License v3.0
998 stars 101 forks source link

understanding class_tokens #189

Closed ledahu closed 1 month ago

ledahu commented 4 months ago

Hi, i don't know if its an issue :/

i have folders in my dataset :

When i start training i get a warnin for each reg image "_neither caption file nor class tokens are found. use empty caption for PATH_TOIMG"

and then in the training start log :

  [Subset 3 of Dataset 0]
    image_dir: "X_TRIGGER classname"
    image_count: 123
    num_repeats: X
    shuffle_caption: False
    keep_tokens: 0
    keep_tokens_separator:
    caption_dropout_rate: 0.0
    caption_dropout_every_n_epoches: 0
    caption_tag_dropout_rate: 0.0
    caption_prefix: None
    caption_suffix: None
    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: None
    caption_extension: .txt

and reg

  [Subset 1 of Dataset 0]
    image_dir: "1_classname"
    image_count: 350
    num_repeats: 1
    shuffle_caption: False
    keep_tokens: 0
    keep_tokens_separator:
    caption_dropout_rate: 0.0
    caption_dropout_every_n_epoches: 0
    caption_tag_dropout_rate: 0.0
    caption_prefix: None
    caption_suffix: None
    color_aug: False
    flip_aug: False
    face_crop_aug_range: None
    random_crop: False
    token_warmup_min: 1,
    token_warmup_step: 0,
    is_reg: True
    class_tokens: None
    caption_extension: .txt

My question is how to ensure that classname is activated ? I was expecting that class_tokens was recognized by the folder name , no ?

Thank you

derrian-distro commented 4 months ago

no, there are no class tokens, you must add the activation token into the captions, as in, you must have a txt file accompanying every image in every folder, including the regularization images.

Jelosus2 commented 1 month ago

Closing this since solution was already given.