[index-tts]windows,用文档里的方法安装依赖后运行报错,_kaldifst动态链接库(DLL)初始化示例程序失败。

2025-10-27 209 views
3
from _kaldifst import (

ImportError: DLL load failed while importing _kaldifst: 动态链接库(DLL)初始化例程失败。

使用uv安装了依赖库 uv sync --default-index "https://mirrors.aliyun.com/pypi/simple" .venv里查看没有问题

运行的cuda toolkit也安装了驱动支持的最高版本

出错的脚本是这个 from indextts.infer_v2 import IndexTTS2

tts = IndexTTS2(cfg_path="checkpoints/config.yaml", model_dir="checkpoints", use_fp16=False, use_cuda_kernel=False, use_deepspeed=False) text = "酒楼丧尽天良,开始借机竞拍房间,哎,一群蠢货。" tts.infer(spk_audio_prompt='examples/voice_07.wav', text=text, output_path="gen.wav", emo_audio_prompt="examples/emo_sad.wav", verbose=True)

需要下载的其他内容也全下完了,以下是全部输出

GPT weights restored from: checkpoints\gpt.pth GPT2InferenceModel has generative capabilities, as prepare_inputs_for_generation is explicitly overwritten. However, it doesn't directly inherit from GenerationMixin. From 👉v4.50👈 onwards, PreTrainedModel will NOT inherit from GenerationMixin, and this model will lose the ability to call generate and other related functions.

  • If you're using trust_remote_code=True, you can get rid of this warning by loading the model with an auto class. See https://huggingface.co/docs/transformers/en/model_doc/auto#auto-classes
  • If you are the owner of the model architecture code, please modify your model class such that it inherits from GenerationMixin (after PreTrainedModel, otherwise you'll get an exception).
  • If you are not the owner of the model architecture class, please contact the model code owner to update it. Failed to load custom CUDA kernel for BigVGAN. Falling back to torch. semantic_codec weights restored from: ./checkpoints/hf_cache\models--amphion--MaskGCT\snapshots\265c6cef07625665d0c28d2faafb1415562379dc\semantic_codec\model.safetensors cfm loaded length_regulator loaded gpt_layer loaded s2mel weights restored from: checkpoints\s2mel.pth campplus_model weights restored from: ./checkpoints/hf_cache\models--funasr--campplus\snapshots\fb71fe990cbf6031ae6987a2d76fe64f94377b7e\campplus_cn_common.bin Loading weights from nvidia/bigvgan_v2_22khz_80band_256x Removing weight norm... bigvgan weights restored from: nvidia/bigvgan_v2_22khz_80band_256x

Traceback (most recent call last): File "E:\code\index-tts-main\script.py", line 3, in tts = IndexTTS2(cfg_path="checkpoints/config.yaml", model_dir="checkpoints", use_fp16=False, use_cuda_kernel=False, use_deepspeed=False) File "E:\code\index-tts-main\indextts\infer_v2.py", line 160, in init self.normalizer.load() File "E:\code\index-tts-main\indextts\utils\front.py", line 95, in load from wetext import Normalizer File "E:\code\index-tts-main.venv\lib\site-packages\wetext__init.py", line 15, in from wetext.utils import ( File "E:\code\index-tts-main.venv\lib\site-packages\wetext\utils.py", line 18, in from wetext.constants import FSTS File "E:\code\index-tts-main.venv\lib\site-packages\wetext\constants.py", line 14, in from kaldifst import TextNormalizer as normalizer File "E:\code\index-tts-main.venv\lib\site-packages\kaldifst\init__.py", line 1, in from _kaldifst import ( ImportError: DLL load failed while importing _kaldifst: 动态链接库(DLL)初始化例程失败。

回答

2

我也遇到了同样的问题。

3

是的,这在 Windows 上不太友好。反正我讨厌 uv,至少在 Windows 上是这样。

7

有趣的是,这个功能在 ComfyUI 里运行起来毫无问题,而且没有任何乱码。我只用 Comfy,不怎么用这个,至少还有一个可行的选择,因为它是一款不错的 TTS。

4

用cosyvoice时遇到这个问题 直接python命令行却不会导入wetext有问题 解决办法时把from wetext import Normalizer as ZhNormalizer提前到所有py代码之前 猜测是因为前面导入的dll的版本和wetext的版本冲突了,所以提前导入wetext可以解决

Originally posted by @shudal in #384

这个解决了,注意是从webui -> infer_v2 -> front 全部报错链涉及到的引入全部要提前到第一行

5

下载并安装(Windows专用): 🔗 https://aka.ms/vs/17/release/vc_redist.x64.exe 安装完成后重启终端或电脑。 我的好了。

安装了还是不行,Win10x64

是的,正如我已经在 Windows 10 上安装的那样。