#7120 shape '[1, 4138, 1, 32, 2]' is invalid for input of size 262144,Traceback (most recent call last): File

188.192**8 Posted at: 15 hours ago

shape '[1, 4138, 1, 32, 2]' is invalid for input of size 262144,Traceback (most recent call last):
File "videotrans\process\confucius_tts.py", line 75, in confucius_fun
File "C:\vTrans\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "videotrans\confuciustts\cli\inference.py", line 332, in generate
File "C:\vTrans\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "videotrans\confuciustts\cli\inference.py", line 246, in _synth_segment
File "C:\vTrans\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "videotrans\confuciustts\flow\flow.py", line 242, in inference
File "C:\vTrans\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "videotrans\confuciustts\flow\flow_matching.py", line 138, in forward
File "videotrans\confuciustts\flow
......
e "videotrans\confuciustts\flow\flow_matching.py", line 178, in solve_euler
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 "videotrans\confuciustts\flow\DiT\dit.py", line 214, in forward
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 "videotrans\confuciustts\flow\DiT\modules.py", line 226, in forward
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 "videotrans\confuciustts\flow\DiT\modules.py", line 175, in forward
File "videotrans\confuciustts\flow\DiT\modules.py", line 129, in apply_rotary_emb
RuntimeError: shape '[1, 4138, 1, 32, 2]' is invalid for input of size 262144

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: C:/Private Filez/Videoz/Zum Übertragen/Dubbing/Dubprogress/1.mkv,
输出结果保存到文件夹: C:/Private Filez/Videoz/Zum Übertragen/Dubbing/Dubprogress/1-mkv,
临时文件夹: C:/vTrans/tmp/5076/a95aac456d
未选 清理已存在
已启用CUDA加速
已选 降噪
已选 识别说话人,最大说话人数量不限制
STT Service:openai-whisper(Built-in), large-v3-turbo, 发音语言: English, 断句方式:默认断句
TranslateSrt:CompatibleAI/LocalModel,原始语言:English,目标语言:German, 已选 SendSRT
TTS Service:Confucius4(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 15 hours ago

This error is caused by a tensor shape mismatch inside the Confucius-TTS model's rotary embedding layer, typically triggered when the reference audio used for voice cloning is too long or the input sequence exceeds what the model can handle. Using the clone role dynamically cuts audio from your source video, and if that cut segment is significantly longer than the recommended 3–10 seconds, the model's internal embedding computation fails with this shape ... invalid for input of size 262144 error.

Solutions (try in order)

  1. Limit reference audio duration

    • Go to Menu → Tools → Advanced Options → ASR Settings
    • Set "Maximum speech duration (s)" to 6–10
    • Set "Minimum speech duration (ms)" to 3000–4000
    • This ensures the cloned reference audio stays within the 3–10s window the TTS model expects.
  2. Test with CUDA disabled

    • Temporarily uncheck "Enable CUDA acceleration" on the main interface and retry.
    • If it works, your GPU may be running out of memory or hitting a CUDA-specific bug in the Confucius model. Reduce the model size or switch to int8/float16 compute type.
  3. Verify model files are complete

    • If the model was partially downloaded, it can produce corrupted tensors. Delete the models/models--netease-youdao--Confucius4-TTS folder and re-download it.
  4. Switch to a different cloning TTS

    • Try OmniVoice-TTS (Built-in), Qwen3-TTS (Built-in), or F5-TTS (Built-in) instead of Confucius. They handle clone mode more robustly.
  5. Avoid clone on this particular video

    • If the source audio quality/segments are problematic, select a fixed TTS voice (e.g., Edge-TTS) instead of clone.

If none of the above resolves it, please provide the latest log from logs/ (bottom ~30 lines) and your exact advanced-option values so we can investigate further.

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