#2864 mat1 and mat2 must have the same dtype, but got Float and BFloat16

223.73* Posted at: 2 days ago 👁18

mat1 and mat2 must have the same dtype, but got Float and BFloat16


=
system:Windows-10-10.0.26100-SP0
version:v3.92
frozen:True
language:zh
root_dir:D:/测试/外语视频翻译中文+中文字幕+中文配音

1 Replies

这个错误表明在运行语音识别时,模型的数据类型不匹配。这通常在使用 faster-whisper 模型并启用了 CUDA 加速时发生,尤其是在 Windows 系统上。

核心原因: 您可能选择了 large-v3 模型,并且 CUDA数据类型 设置为了 bfloat16,但您的显卡或驱动不完全支持 bfloat16 运算。

请按以下步骤解决:

  1. (首选方案)修改 CUDA 数据类型:

    • 在软件主界面,点击菜单栏的 工具 -> 选项 -> 高级选项
    • Faster/OpenAI/Whisper 语音识别 区域,找到 CUDA数据类型
    • 将其从 bfloat16 改为 float16int8
    • 点击 保存 并重启软件,然后重试。
  2. (备选方案)更换更小的模型:

    • 在主界面 语音识别 区域,将模型从 large-v3 更换为 mediumsmall。这些模型对数据类型兼容性更好,且显存占用更低。
  3. (临时方案)关闭 CUDA 加速:

    • 在主界面第6行,取消勾选 CUDA加速,改为使用 CPU 运行。这会导致处理速度变慢,但可以绕过显卡兼容性问题。

预防建议:

  • 对于 Windows 用户,使用 float16 通常比 bfloat16 兼容性更好,且速度和精度损失很小。
  • 如果显存不足(例如小于 8GB),强烈建议使用 int8 数据类型,并配合 mediumsmall 模型。

请查看更多参考文档:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Related resource