#7491 The size of tensor a (8926) must match the size of tensor b (8192) at non-singleton dimension 1,Traceback (most recent c

188.192**8 Posted at: 1 hour ago

The size of tensor a (8926) must match the size of tensor b (8192) at non-singleton dimension 1,Traceback (most recent call last):
File "videotrans\process\f5_tts.py", line 147, in f5tts_fun
File "f5_tts\api.py", line 124, in infer

wav, sr, spec = infer_process(

File "f5_tts\infer\utils_infer.py", line 416, in infer_process

return next(

File "f5_tts\infer\utils_infer.py", line 543, in infer_batch_process

result = future.result()

File "concurrent\futures\_base.py", line 458, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "concurrent\futures\thread.py", line 58, in run
File "f5_tts\infer\utils_infer.py", line 523, in infer_single_process

generated_wave, generated = _infer_basic(gen_text)

File "f5_tts\infer\utils_infer.py", line 497, in _infer_basic

generated, _ = model_obj.sample(

File "C:\vTrans\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

Fil
......
es\module.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "C:\vTrans\_internal\torchdiffeq\_impl\misc.py", line 197, in forward

return self.base_func(t, y)

File "f5_tts\model\cfm.py", line 181, in fn

pred_cfg = self.transformer(

File "C:\vTrans\_internal\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl

return self._call_impl(*args, **kwargs)

File "C:\vTrans\_internal\torch\nn\modules\module.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "f5_tts\model\backbones\dit.py", line 338, in forward

x_cond = self.get_input_embed(

File "f5_tts\model\backbones\dit.py", line 299, in get_input_embed

text_embed = self.text_embed(text, seq_len=seq_len, drop_text=drop_text)

File "C:\vTrans\_internal\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl

return self._call_impl(*args, **kwargs)

File "C:\vTrans\_internal\torch\nn\modules\module.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "f5_tts\model\backbones\dit.py", line 120, in forward

text = text + freqs

RuntimeError: The size of tensor a (8926) must match the size of tensor b (8192) at non-singleton dimension 1

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Private Filez/Videoz/Zum Übertragen/Dubbing/Dubprogress/111808.wmv,
输出结果保存到文件夹: C:/Private Filez/Videoz/Zum Übertragen/Dubbing/Dubprogress/111808-wmv,
临时文件夹: C:/vTrans/tmp/42372/c8fbac555b
未选 清理已存在
已启用CUDA加速
已选 降噪
已选 识别说话人,最大说话人数量不限制
STT Service:openai-whisper(Built-in), large-v3-turbo, 发音语言: English, 断句方式:默认断句
TranslateSrt:CompatibleAI/LocalModel,原始语言:English,目标语言:German, 未选 SendSRT
TTS Service:F5-TTS(Built-in), 角色:clone, 配音语言:German, 未选 二次语音识别
音量:-1%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: No Subtitles
已选 分离人声与背景声, 已选 重新嵌入背景声, 背景音量0.8, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件


=
system:Windows-10-10.0.26200-SP0
version:v4.12
frozen:True
language:en_US
root_dir:C:/vTrans

1 Replies

#1 DeepSeek reply at 1 hour ago

This is a tensor dimension mismatch error inside the F5-TTS model, caused by a mismatch between the reference audio duration and the target text length — specifically the "clone" character mode cutting reference audio segments that are too long (or the target text being too long), exceeding the model's fixed positional embedding limit of 8192.

Core cause:
You are using F5-TTS (Built-in) with 角色: clone. F5-TTS dynamically cuts a reference audio slice from the original video based on subtitle timing. If the subtitle segment is too long (and/or the target German text is very long), the combined sequence of reference audio tokens + text tokens exceeds the model's max_seq_len (8192), producing:

The size of tensor a (8926) must match the size of tensor b (8192)

Solutions (apply in order):

  1. Shorten the subtitle/segment duration — go to Menu → Tools → Advanced Options → Speech Recognition Parameters:

    • Longest speech duration (s) : set to 4 or 5
    • Shortest speech duration (ms) : keep ≥ 3000 (required for clone mode)
    • Silence split duration (ms) : set to 300400
      This produces shorter reference audio slices so the sequence never exceeds 8192.
  2. Reduce target text length — F5-TTS also limits by the target text token count. Long translated German sentences can push the total over the limit. Enable subtitle/translation cleanup:

    • Use Menu → Tools → Advanced Options → Translation → Send complete subtitles = OFF, and set AI translation batch lines = 1, so every subtitle line stays short.
    • If still too long, switch the translation channel from "CompatibleAI/LocalModel" to DeepSeek (better instruction-following, avoids merging/expanding lines).
  3. Switch reference audio — if the problem persists, replace clone with an explicit voice, or provide your own 3–10s clean WAV reference:

    • Put a 3–10 s, single-speaker, mono WAV into the f5-tts/ folder.
    • Then Menu → TTS Settings → Set reference audio, format: filename.wav#spoken text.
    • Select that filename as the dubbing role instead of clone.
  4. Verify the source problem — F5-TTS only reliably handles 中/英/日/法/德/俄/意/西/印地/阿拉伯语 with short segments. Your target is German, which is supported, but only if segments stay short (rule 1).
  5. Disable "Separate vocal/background" while testing — it is unrelated to this error but adds significant CPU time; you can re-enable it after the dubbing stage succeeds.

If the error persists after the above, please try:

  • Menu → Tools → Advanced Options → Dubbing → Remove silence buffer before/after dubbing = ON
  • Or switch to another clone-capable channel such as OmniVoice-TTS or ChatterBox, both of which handle longer inputs more robustly than F5-TTS.

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource