使用PeftModel加载LoRA权重后,模型开始训练时报错,导致无法开始训练:
AssertionError: No inf checks were recorded for this optimizer.
只需在加载LoRA权重时将参数is_trainable
设置为True
model = PeftModel.from_pretrained(model, lora_checkpoint, is_trainable=True)
使用PeftModel加载LoRA权重后,模型开始训练时报错,导致无法开始训练:
AssertionError: No inf checks were recorded for this optimizer.
只需在加载LoRA权重时将参数is_trainable
设置为True
model = PeftModel.from_pretrained(model, lora_checkpoint, is_trainable=True)