kohya-ss / sd-scripts

Apache License 2.0
5.12k stars 853 forks source link

what's the value for --noise_offset #211

Open tcflying opened 1 year ago

tcflying commented 1 year ago

(venv) PS G:\sd-scripts> accelerate launch --num_cpu_threads_per_process 2 train_network.py `

--pretrained_model_name_or_path=F:\stable-diffusion-webui\models\Stable-diffusion\dreamshaper_332BakedVaeClipFix.safetensors `
--train_data_dir=G:\dls\all\4 `
--output_dir=F:\stable-diffusion-webui\models\Lora `
--output_name=t1 `
--caption_extension=.txt `
--prior_loss_weight=1.0 `
--resolution=768,768 `
--enable_bucket `
--train_batch_size=6 `
--learning_rate=5e-4 `
--unet_lr=5e-4 `
--text_encoder_lr=5e-5 `
--max_train_epochs=6 `
--network_module=networks.lora `
--network_dim=128 `
--network_alpha=128 `
--use_8bit_adam `
--xformers `
--mixed_precision=bf16 `
--lr_scheduler=constant `
--verbose `
--noise_offset `
--save_every_n_epochs=1 `
--save_model_as=safetensors --clip_skip=1 --seed=42 `
--persistent_data_loader_workers

usage: train_network.py [-h] [--v2] [--v_parameterization] [--pretrained_model_name_or_path PRETRAINED_MODEL_NAME_OR_PATH] [--train_data_dir TRAIN_DATA_DIR] [--shuffle_caption] [--caption_extension CAPTION_EXTENSION] [--caption_extention CAPTION_EXTENTION] [--keep_tokens KEEP_TOKENS] [--color_aug] [--flip_aug] [--face_crop_aug_range FACE_CROP_AUG_RANGE] [--random_crop] [--debug_dataset] [--resolution RESOLUTION] [--cache_latents] [--enable_bucket] [--min_bucket_reso MIN_BUCKET_RESO] [--max_bucket_reso MAX_BUCKET_RESO] [--bucket_reso_steps BUCKET_RESO_STEPS] [--bucket_no_upscale] [--caption_dropout_rate CAPTION_DROPOUT_RATE] [--caption_dropout_every_n_epochs CAPTION_DROPOUT_EVERY_N_EPOCHS] [--caption_tag_dropout_rate CAPTION_TAG_DROPOUT_RATE] [--reg_data_dir REG_DATA_DIR] [--in_json IN_JSON] [--dataset_repeats DATASET_REPEATS] [--output_dir OUTPUT_DIR] [--output_name OUTPUT_NAME] [--save_precision {None,float,fp16,bf16}] [--save_every_n_epochs SAVE_EVERY_N_EPOCHS] [--save_n_epoch_ratio SAVE_N_EPOCH_RATIO] [--save_last_n_epochs SAVE_LAST_N_EPOCHS] [--save_last_n_epochs_state SAVE_LAST_N_EPOCHS_STATE] [--save_state] [--resume RESUME] [--train_batch_size TRAIN_BATCH_SIZE] [--max_token_length {None,150,225}] [--use_8bit_adam] [--use_lion_optimizer] [--mem_eff_attn] [--xformers] [--vae VAE] [--learning_rate LEARNING_RATE] [--max_train_steps MAX_TRAIN_STEPS] [--max_train_epochs MAX_TRAIN_EPOCHS] [--max_data_loader_n_workers MAX_DATA_LOADER_N_WORKERS] [--persistent_data_loader_workers] [--seed SEED] [--gradient_checkpointing] [--gradient_accumulation_steps GRADIENT_ACCUMULATION_STEPS] [--mixed_precision {no,fp16,bf16}] [--full_fp16] [--clip_skip CLIP_SKIP] [--logging_dir LOGGING_DIR] [--log_prefix LOG_PREFIX] [--lr_scheduler LR_SCHEDULER] [--lr_warmup_steps LR_WARMUP_STEPS] [--noise_offset NOISE_OFFSET] [--lowram] [--prior_loss_weight PRIOR_LOSS_WEIGHT] [--no_metadata] [--save_model_as {None,ckpt,pt,safetensors}] [--unet_lr UNET_LR] [--text_encoder_lr TEXT_ENCODER_LR] [--lr_scheduler_num_cycles LR_SCHEDULER_NUM_CYCLES] [--lr_scheduler_power LR_SCHEDULER_POWER] [--network_weights NETWORK_WEIGHTS] [--network_module NETWORK_MODULE] [--network_dim NETWORK_DIM] [--network_alpha NETWORK_ALPHA] [--network_args [NETWORK_ARGS ...]] [--network_train_unet_only] [--network_train_text_encoder_only] [--training_comment TRAINING_COMMENT] train_network.py: error: argument --noise_offset: expected one argument Traceback (most recent call last): File "C:\Users\Administrator\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\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "G:\sd-scripts\venv\Scripts\accelerate.exe__main__.py", line 7, in File "G:\sd-scripts\venv\lib\site-packages\accelerate\commands\accelerate_cli.py", line 45, in main args.func(args) File "G:\sd-scripts\venv\lib\site-packages\accelerate\commands\launch.py", line 1104, in launch_command simple_launcher(args) File "G:\sd-scripts\venv\lib\site-packages\accelerate\commands\launch.py", line 567, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd) subprocess.CalledProcessError: Command '['G:\sd-scripts\venv\Scripts\python.exe', 'train_network.py', '--pretrained_model_name_or_path=F:\stable-diffusion-webui\models\Stable-diffusion\dreamshaper_332BakedVaeClipFix.safetensors', '--train_data_dir=G:\dls\all\4', '--output_dir=F:\stable-diffusion-webui\models\Lora', '--output_name=t1', '--caption_extension=.txt', '--prior_loss_weight=1.0', '--resolution=768,768', '--enable_bucket', '--train_batch_size=6', '--learning_rate=5e-4', '--unet_lr=5e-4', '--text_encoder_lr=5e-5', '--max_train_epochs=6', '--network_module=networks.lora', '--network_dim=128', '--network_alpha=128', '--use_8bit_adam', '--xformers', '--mixed_precision=bf16', '--lr_scheduler=constant', '--verbose', '--noise_offset', '--save_every_n_epochs=1', '--save_model_as=safetensors', '--clip_skip=1', '--seed=42', '--persistent_data_loader_workers']' returned non-zero exit status 2. (venv) PS G:\sd-scripts>

tcflying commented 1 year ago

sorry, the same question like it. that's --verbose

rockerBOO commented 1 year ago

try 0.1. See https://www.crosslabs.org//blog/diffusion-with-offset-noise

tcflying commented 1 year ago

thank you so much, what about --verbose?

ThisIsCyreX commented 1 year ago

--verbose is just a flag to add more details into the log, see: https://github.com/kohya-ss/sd-scripts/pull/179

add --verbose flag to print additional statistics in resize_lora_model function

You could just remove --verbose if you want