lrzjason / T2ITrainer

Practice Code for text to image trainer
GNU Affero General Public License v3.0
82 stars 5 forks source link

Error when starting train_hunyuan_lora_ui.py #9

Open a-l-e-x-d-s-9 opened 3 months ago

a-l-e-x-d-s-9 commented 3 months ago

Trying to run train_hunyuan_lora_ui.py, and getting the following error:

python train_hunyuan_lora_ui.py --seed 12151004 --logging_dir logs --mixed_precision bf16 --report_to wandb --lr_warmup_steps 0 --output_dir /home/alexds9/stable-diffusion-webui/models/Lora/My/hunyuan/morph/whipped_cream/ --save_name wheepflx_style_ --train_data_dir /home/alexds9/Documents/stable_diffusion/Morphs/WhimpCreem/dataset/5_images/ --optimizer adamw --lr_scheduler cosine --learning_rate 0.0001 --train_batch_size 4 --repeats 5 --gradient_accumulation_steps 1 --num_train_epochs 20 --save_model_epochs 4 --validation_epochs 0 --rank 32 --skip_epoch 0 --break_epoch 0 --skip_step 0 --gradient_checkpointing --validation_ratio 0 --pretrained_model_name_or_path /home/alexds9/stable-diffusion-webui/models/Stable-diffusion/HunyuanDiT-v1.2-Diffusers/  --vae_path /home/alexds9/stable-diffusion-webui/models/Stable-diffusion/HunyuanDiT-v1.2/t2i/sdxl-vae-fp16-fix/diffusion_pytorch_model.safetensors
/home/alexds9/Documents/stable_diffusion/T2ITrainer/venv/lib/python3.10/site-packages/accelerate/accelerator.py:406: UserWarning: `log_with=wandb` was passed but no supported trackers are currently installed.
  warnings.warn(f"`log_with={log_with}` was passed but no supported trackers are currently installed.")
The config attributes {'use_style_cond_and_image_meta_size': False} were passed to HunyuanDiT2DModel, but are not expected and will be ignored. Please verify your config.json configuration file.
Traceback (most recent call last):
  File "/home/alexds9/Documents/stable_diffusion/T2ITrainer/train_hunyuan_lora_ui.py", line 1128, in <module>
    main(args)
  File "/home/alexds9/Documents/stable_diffusion/T2ITrainer/train_hunyuan_lora_ui.py", line 476, in main
    transformer = HunyuanDiT2DModel.from_pretrained(
  File "/home/alexds9/Documents/stable_diffusion/T2ITrainer/venv/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
  File "/home/alexds9/Documents/stable_diffusion/T2ITrainer/venv/lib/python3.10/site-packages/diffusers/models/modeling_utils.py", line 750, in from_pretrained
    raise ValueError(
ValueError: Cannot load <class 'diffusers.models.transformers.hunyuan_transformer_2d.HunyuanDiT2DModel'> from /home/alexds9/stable-diffusion-webui/models/Stable-diffusion/HunyuanDiT-v1.2-Diffusers/ because the following keys are missing: 
 time_extra_emb.style_embedder.weight. 
 Please make sure to pass `low_cpu_mem_usage=False` and `device_map=None` if you want to randomly initialize those weights or else make sure your checkpoint file is correct.
lrzjason commented 3 months ago

Train_hunyuan_lora_ui.py needs to be updated. The current trainer focus on kolors training. I would update this thread when Train_hunyuan_lora_ui.py supports 1.2 lora training (1.1 would no longer be supported).