#4120 RuntimeError: {'message': 'tts failed', 'Exception': 'expected scalar type Half but found Float'}

89.208* Posted at: 2 hours ago 👁7

{'message': 'tts failed', 'Exception': 'expected scalar type Half but found Float'}:
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 16, in run
File "videotrans\tts\__init__.py", line 370, in run
File "videotrans\tts\_base.py", line 181, in run
RuntimeError: {'message': 'tts failed', 'Exception': 'expected scalar type Half but found Float'}


=
system:Windows-10-10.0.26200-SP0
version:v3.99
frozen:True
language:zh
root_dir:D:/win-pyvideotrans-v3.99

1 Replies

这是由于 TTS 模型数据类型不匹配导致的。具体是模型期望使用 Half (float16) 数据类型,但输入数据是 Float (float32) 类型。

解决方案:

  1. 进入软件顶部菜单栏,选择 工具/选项 -> 高级选项
  2. 在打开的窗口中,找到 【语音识别参数】 区域。
  3. 找到 CUDA数据类型 选项。
  4. 将其值从 float32default 修改为 float16
  5. 点击 保存 按钮,然后关闭高级选项窗口。
  6. 重新尝试进行配音任务。

如果问题依然存在,请尝试以下步骤:

  1. 高级选项 -> 【语音识别参数】 区域,检查并降低 识别准确度beam_size识别准确度best_of 的值(例如从 5 改为 1)。
  2. 确保您使用的 TTS 模型与您的显卡显存兼容。如果显存较小(例如小于 8GB),请考虑使用更小的模型或在线 TTS 服务(如 Edge-TTS)。

请查阅相关文档:

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