[BUG] <title>LORA微调后保存的权重没有vpm_resampler_embedtokens.pt
1SingleFeng opened this issue · comments
是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?
- 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions
该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?
- 我已经搜索过FAQ | I have searched FAQ
当前行为 | Current Behavior
https://github.com/OpenBMB/MiniCPM-V/tree/main/finetune#lora-finetuning
根据这个链接下的信息,按理说lora微调训练后保存的权重应该有vpm_resampler_embedtokens.pt,但是在我的训练结果下并没有发现
期望行为 | Expected Behavior
lora微调训练后保存的权重应该有vpm_resampler_embedtokens.pt
复现方法 | Steps To Reproduce
No response
运行环境 | Environment
- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):
备注 | Anything else?
No response
我是在zero3配置下训练的结果
我是在zero3配置下训练的结果
在训练脚本里,我也开启了 --tune_vision true
the same issue #243 I don't know why it took so long to fix it.
你好,最新版的代码貌似解决了这个问题,我还在验证
import torch
文件路径
file_path = '/root/ld/ld_project/pull_request/MiniCPM-V/finetune/output/output_minicpmv2_lora/checkpoint-10/vpm_resampler_embedtokens.pt'
使用torch.load加载文件
checkpoint = torch.load(file_path, map_location=torch.device('cpu')) # 或'mcuda:0'如果你在GPU上运行
print(checkpoint.keys())
Using the above script, you can find that the weight of vpm_resampler_embedtokens.pt obtained by lora fine-tuning includes the weights of llm's embedding, vit and resample.