自学内容网 自学内容网

【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


原文地址:https://blog.csdn.net/Everglowwwwww/article/details/142320410

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!