kohya-ss / kohya-ss/sd-scripts
loss=nan training lora base on sdxl
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.2k
- Avg merge
- 11m
- Merged PRs (30d)
- 2
Description
I've got avr_loss=nan while training lora base on sdxl
Here is my config:
{
"LoRA_type": "Standard",
"LyCORIS_preset": "full",
"adaptive_noise_scale": 0,
"additional_parameters": "",
"ae": "",
"apply_t5_attn_mask": false,
"async_upload": false,
"block_alphas": null,
"block_dims": null,
"block_lr_zero_threshold": "",
"blocks_to_swap": 0,
"bucket_no_upscale": true,
"bucket_reso_steps": 64,
"bypass_mode": false,
"cache_latents": true,
"cache_latents_to_disk": true,
"caption_dropout_every_n_epochs": 0,
"caption_dropout_rate": 0,
"caption_extension": ".txt",
"clip_g": "",
"clip_g_dropout_rate": 0,
"clip_l": "",
"clip_skip": 1,
"color_aug": false,
"constrain": 0,
"conv_alpha": 1,
"conv_block_alphas": null,
"conv_block_dims": null,
"conv_dim": 1,
"cpu_offload_checkpointing": false,
"dataset_config": "",
"debiased_estimation_loss": false,
"decompose_both": false,
"dim_from_weights": false,
"discrete_flow_shift": 3,
"dora_wd": false,
"double_blocks_to_swap": 0,
"down_lr_weight": "",
"dynamo_backend": "no",
"dynamo_mode": "default",
"dynamo_use_dynamic": false,
"dynamo_use_fullgraph": false,
"enable_all_linear": false,
"enable_bucket": true,
"epoch": 1,
"extra_accelerate_launch_args": "",
"factor": -1,
"flip_aug": false,
"flux1_cache_text_encoder_outputs": false,
"flux1_cache_text_encoder_outputs_to_disk": false,
"flux1_checkbox": false,
"fp8_base": false,
"fp8_base_unet": false,
"full_bf16": false,
"full_fp16": false,
"ggpo_beta": 0.01,
"ggpo_sigma": 0.03,
"gpu_ids": "",
"gradient_accumulation_steps": 1,
"gradient_checkpointing": true,
"guidance_scale": 3.5,
"highvram": false,
"huber_c": 0.1,
"huber_scale": 1,
"huber_schedule": "snr",
"huggingface_path_in_repo": "",
"huggingface_repo_id": "",
"huggingface_repo_type": "",
"huggingface_repo_visibility": "",
"huggingface_token": "",
"img_attn_dim": "",
"img_mlp_dim": "",
"img_mod_dim": "",
"in_dims": "",
"ip_noise_gamma": 0,
"ip_noise_gamma_random_strength": false,
"keep_tokens": 0,
"learning_rate": 1e-05,
"log_config": false,
"log_tracker_config": "",
"log_tracker_name": "",
"log_with": "",
"logging_dir": "/home/xx/Documents/kohya_ss/logs",
"logit_mean": 0,
"logit_std": 1,
"loraplus_lr_ratio": 0,
"loraplus_text_encoder_lr_ratio": 0,
"loraplus_unet_lr_ratio": 0,
"loss_type": "l2",
"lowvram": false,
"lr_scheduler": "cosine",
"lr_scheduler_args": "",
"lr_scheduler_num_cycles": 1,
"lr_scheduler_power": 1,
"lr_scheduler_type": "",
"lr_warmup": 10,
"lr_warmup_steps": 0,
"main_process_port": 0,
"masked_loss": false,
"max_bucket_reso": 2048,
"max_data_loader_n_workers": 0,
"max_grad_norm": 1,
"max_resolution": "512,512",
"max_timestep": 1000,
"max_token_length": 75,
"max_train_epochs": 0,
"max_train_steps": 1600,
"mem_eff_attn": false,
"mem_eff_save": false,
"metadata_author": "",
"metadata_description": "",
"metadata_license": "",
"metadata_tags": "",
"metadata_title": "",
"mid_lr_weight": "",
"min_bucket_reso": 256,
"min_snr_gamma": 0,
"min_timestep": 0,
"mixed_precision": "bf16",
"mode_scale": 1.29,
"model_list": "",
"model_prediction_type": "sigma_scaled",
"module_dropout": 0,
"multi_gpu": false,
"multires_noise_discount": 0.3,
"multires_noise_iterations": 0,
"network_alpha": 1,
"network_dim": 8,
"network_dropout": 0,
"network_weights": "",
"noise_offset": 0,
"noise_offset_random_strength": false,
"noise_offset_type": "Original",
"num_cpu_threads_per_process": 2,
"num_machines": 1,
"num_processes": 1,
"optimizer": "AdamW8bit",
"optimizer_args": "",
"output_dir": "/home/xx/Documents/kohya_ss/outputs",
"output_name": "last",
"persistent_data_loader_workers": false,
"pos_emb_random_crop_rate": 0,
"pretrained_model_name_or_path": "/home/xx/Documents/ComfyUI/models/checkpoints/sd_xl_base_1.0_0.9vae.safetensors",
"prior_loss_weight": 1,
"random_crop": false,
"rank_dropout": 0,
"rank_dropout_scale": false,
"reg_data_dir": "",
"rescaled": false,
"resume": "",
"resume_from_huggingface": "",
"sample_every_n_epochs": 0,
"sample_every_n_steps": 0,
"sample_prompts": "",
"sample_sampler": "euler_a",
"save_clip": false,
"save_every_n_epochs": 1,
"save_every_n_steps": 0,
"save_last_n_epochs": 0,
"save_last_n_epochs_state": 0,
"save_last_n_steps": 0,
"save_last_n_steps_state": 0,
"save_model_as": "safetensors",
"save_precision": "bf16",
"save_state": false,
"save_state_on_train_end": false,
"save_state_to_huggingface": false,
"save_t5xxl": false,
"scale_v_pred_loss_like_noise_pred": false,
"scale_weight_norms": 0,
"sd3_cache_text_encoder_outputs": false,
"sd3_cache_text_encoder_outputs_to_disk": false,
"sd3_checkbox": false,
"sd3_clip_l": "",
"sd3_clip_l_dropout_rate": 0,
"sd3_disable_mmap_load_safetensors": false,
"sd3_enable_scaled_pos_embed": false,
"sd3_fused_backward_pass": false,
"sd3_t5_dropout_rate": 0,
"sd3_t5xxl": "",
"sd3_text_encoder_batch_size": 1,
"sdxl": true,
"sdxl_cache_text_encoder_outputs": false,
"sdxl_no_half_vae": true,
"seed": 0,
"shuffle_caption": false,
"single_blocks_to_swap": 0,
"single_dim": "",
"single_mod_dim": "",
"skip_cache_check": false,
"split_mode": false,
"split_qkv": false,
"stop_text_encoder_training": 0,
"t5xxl": "",
"t5xxl_device": "",
"t5xxl_dtype": "bf16",
"t5xxl_lr": 0,
"t5xxl_max_token_length": 512,
"text_encoder_lr": 0,
"timestep_sampling": "sigma",
"train_batch_size": 1,
"train_blocks": "all",
"train_data_dir": "/home/xx/Documents/data/sd_data/img_folder",
"train_double_block_indices": "all",
"train_lora_ggpo": false,
"train_norm": false,
"train_on_input": true,
"train_single_block_indices": "all",
"train_t5xxl": false,
"training_comment": "",
"txt_attn_dim": "",
"txt_mlp_dim": "",
"txt_mod_dim": "",
"unet_lr": 0,
"unit": 1,
"up_lr_weight": "",
"use_cp": false,
"use_scalar": false,
"use_tucker": false,
"v2": false,
"v_parameterization": false,
"v_pred_like_loss": 0,
"vae": "",
"vae_batch_size": 0,
"wandb_api_key": "",
"wandb_run_name": "",
"weighted_captions": false,
"weighting_scheme": "logit_normal",
"xformers": "xformers"
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Begin by reproducing the SDXL LoRA training run from the supplied configuration and capture when avr_loss first becomes NaN. No repository file, test, or command is identified; done would require identifying the cause and verifying a training run without NaN loss.
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
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100