【bug】通过lora方式微调sdxl inpainting踩坑
报错内容
ValueError: Attempting to unscale FP16 gradients.
报错位置
if accelerator.sync_gradients:
params_to_clip = (
itertools.chain(unet_lora_parameters, text_lora_parameters_one, text_lora_parameters_two)
if args.train_text_encoder
else unet_lora_parameters
)
accelerator.clip_grad_norm_(params_to_clip, args.max_grad_norm)
解决
https://github.com/huggingface/accelerate/issues/1778