MiniCPM-V icon indicating copy to clipboard operation
MiniCPM-V copied to clipboard

[BUG] <title>模型正常,使用原始模型可以正常推理,微调过后出现 RuntimeError: probability tensor contains either inf, nan or element < 0

Open Hiwyl opened this issue 1 year ago • 1 comments

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

  • [X] 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

  • [X] 我已经搜索过FAQ | I have searched FAQ

当前行为 | Current Behavior

No response

期望行为 | Expected Behavior

No response

复现方法 | Steps To Reproduce

No response

运行环境 | Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA (`python -c 'import torch; print(torch.version.cuda)'`):

备注 | Anything else?

v2.6模型正常,使用原始模型可以正常推理,微调过后出现 RuntimeError: probability tensor contains either inf, nan or element < 0

Hiwyl avatar Sep 02 '24 06:09 Hiwyl

可能是精度溢出了,可以使用fp32试一试有没有问题,如果没有问题那就是精度溢出了

LDLINGLINGLING avatar Sep 02 '24 07:09 LDLINGLINGLING

斯这种有别的解决办法吗?因为V100只能float16不能bf16 ,32显存就爆炸了

BlackTea-c avatar Mar 13 '25 04:03 BlackTea-c