#3721 Active code page: 65001F:\BaiduNetdiskDownload\f5-tts-20251228\runtime\Lib\site-packages\google\api_core\_python_version

155.117* Posted at: 2 hours ago 👁20

Active code page: 65001
F:\BaiduNetdiskDownload\f5-tts-20251228\runtime\Lib\site-packages\google\api_core\_python_version_support.py:266: FutureWarning: You are using a Python version (3.10.11) which Google will stop supporting in new releases of google.api_core once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.api_core past that date.
warnings.warn(message, FutureWarning)
Load vocos from local path F:/BaiduNetdiskDownload/f5-tts-20251228/ckpts
Traceback (most recent call last):
File "F:\BaiduNetdiskDownload\f5-tts-20251228\src\f5_tts\infer\infer_gradio.py", line 68, in

vocoder = load_vocoder(is_local=True,local_path=CKPTS_PATH)

File "F:\BaiduNetdiskDownload\f5-tts-20251228\src\f5_tts\infer\utils_infer.py", line 118, in load_vocoder

state_dict = torch.load(model_path, map_location="cpu", weights_only=True)

File "F:\BaiduNetdiskDownload\f5-tts-20251228\runtime\Lib\site-packages\torch\serialization.py", line 1572, in load

raise pickle.UnpicklingError(_get_wo_message(str(e))) from None

_pickle.UnpicklingError: Weights only load failed. In PyTorch 2.6, we changed the default value of the weights_only argument in torch.load from False to True. Re-running torch.load with weights_only set to False will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
Please file an issue with the following so that we can make weights_only=True compatible with your use case: WeightsUnpickler error:

Unsupported operand 16

Check the documentation of torch.load to learn more about types accepted by default with weights_only https://pytorch.org/docs/stable/generated/torch.load.html.
Press any key to continue . . .

1 Replies

这是由于 F5-TTS 项目使用的 PyTorch 版本(2.6)默认加载模型文件时启用了 weights_only=True 安全限制,而您下载的模型文件格式与该限制不兼容。

解决方案:

  1. 修改 F5-TTS 源码:打开文件 F:\BaiduNetdiskDownload\f5-tts-20251228\src\f5_tts\infer\utils_infer.py
  2. 找到第 118 行附近,内容应为:
    state_dict = torch.load(model_path, map_location="cpu", weights_only=True)
  3. weights_only=True 修改为 weights_only=False
  4. 保存文件,然后重新启动 F5-TTS 的 Gradio 服务。

重要提示:此操作会降低模型加载时的安全性,仅应在您确认模型文件来源可信(例如从官方项目下载)时进行。修改后,F5-TTS 服务应能正常启动,之后便可在 pyVideoTrans 中配置使用。

请查阅相关文档:

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