Chinese-LLaMA-Alpaca-3
Chinese-LLaMA-Alpaca-3 copied to clipboard
微调过程loss为0, grad_norm为nan
提交前必须检查以下项目
- [X] 请确保使用的是仓库最新代码(git pull)
- [X] 已阅读项目文档和FAQ章节并且已在Issue中对问题进行了搜索,没有找到相似问题和解决方案。
- [X] 第三方插件问题:例如llama.cpp、text-generation-webui等,建议优先去对应的项目中查找解决方案。
问题类型
模型训练与精调
基础模型
Llama-3-Chinese-8B(基座模型)
操作系统
Linux
详细描述问题
在自己数据集上进行微调,但是训练过程loss为0,grad_norm为nan,请问是什么问题?
依赖情况(代码类问题务必提供)
# 请在此处粘贴依赖情况(请粘贴在本代码块里)
运行日志或截图
开启bf16了吗?
是的,按照提供的参数脚本训练的 @iMountTai
确认一下数据长度和你设置的max_seq_lenth
是否匹配,可能是因为你的output并没有计入logits
I ran into the same situation where I had limited the length of the data set to 3000 and max_length to 4096
请问解决了吗?目前我也遇到了同样的问题
Chinese-LLaMA-Alpaca-3 提供的脚本没出现这个问题,但是使用 unsloth 提供的llama3训练脚本生成的lora模型,再次训练会出现这个问题。
使用 kigner/ruozhiba-llama3-tt 数据集在 hfl/llama-3-chinese-8b-instruct-v2 上训练也出现了这个问题,暂时找到解决办法...
I ran into the same situation where I had limited the length of the data set to 3000 and max_length to 4096
用LLAMA-factory训练了,一切正常
{'loss': 3.3183, 'grad_norm': nan, 'learning_rate': 1.707941929974381e-08, 'epoch': 0.0}
{'loss': 0.0, 'grad_norm': nan, 'learning_rate': 1.707941929974381e-07, 'epoch': 0.0}
我这也是一样的问题。
通过升级bitsandbytes到最新,问题解决 bitsandbytes 0.42.0
升级到 bitsandbytes 0.43.1
我也遇到了这个问题,升级了bitsandbytes之后并没有解决
@aa200647963 你试试用Instruct的tokenizer。
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your consideration.
Closing the issue, since no updates observed. Feel free to re-open if you need any further assistance.