#5272 TaskCfgVTT(uuid='2434f1fe9b', name='C:/Users/zwsoft/Desktop/WuKong 2027 DEMO.mp4', dirname='C:/Users/zwsoft/Desktop', no

31.22* Posted at: 2 days ago

Batch size mismatch: audio=8, context=0:Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 559, in qwen3asr_fun
File "torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "D:\videotrans\_internal\qwen_asr\inference\qwen3_asr.py", line 345, in transcribe

raise ValueError(f"Batch size mismatch: audio={n}, context={len(ctxs)}")

ValueError: Batch size mismatch: audio=8, context=0
[Qwen-ASR(本地内置), DeepSeek, Edge-TTS(免费)]
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 47, in run
File "videotrans\task\trans_create.py", line 317, in recogn
File "videotrans\recognition\__init__.py", line 190, in run
File "videotrans\recognition\_base.py", line 94, in run
File "videotrans\recognition\_qwenasrlocal.py", line 45, in _exec
File "videotrans\configure\base.py", line 268, in _new_process
videotrans.configure.excepts.VideoTransError: Batch size mismatch: audio=8, context=0:Traceback (most recent call last):
File "videotrans\process\stt_fun.py", line 559, in qwen3asr_fun
File "torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "D:\videotrans\_internal\qwen_asr\inference\qwen3_asr.py", line 345, in transcribe

raise ValueError(f"Batch size mismatch: audio={n}, context={len(ctxs)}")

ValueError: Batch size mismatch: audio=8, context=0
TaskCfgVTT(uuid='2434f1fe9b', name='C:/Users/zwsoft/Desktop/WuKong 2027 DEMO.mp4', dirname='C:/Users/zwsoft/Desktop', noextname='WuKong 2027 DEMO', basename='WuKong 2027 DEMO.mp4', ext='mp4', target_dir='WuKong 2027 DEMO-mp4', cache_folder='D:/videotrans/tmp/22188/2434f1fe9b', is_cuda=True, source_language='英语', source_language_code='en', source_sub='WuKong 2027 DEMO-mp4/en.srt', source_wav='D:/videotrans/tmp/22188/2434f1fe9b/en.wav', source_wav_output='WuKong 2027 DEMO-mp4/en.m4a', target_language='简体中文', target_language_code='zh-cn', target_sub='WuKong 2027 DEMO-mp4/zh-cn.srt', target_wav='D:/videotrans/tmp/22188/2434f1fe9b/target.wav', target_wav_output='WuKong 2027 DEMO-mp4/zh-cn.m4a', translate_type=4, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='No', voice_autorate=True, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, detect_language='en', recogn_type=2, model_name='1.7B', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=0, fix_punc=0, subtitle_language=None, app_mode='biaozhun', subtitles='', targetdir_mp4='WuKong 2027 DEMO-mp4/WuKong 2027 DEMO.mp4', novoice_mp4='D:/videotrans/tmp/22188/2434f1fe9b/novoice.mp4', is_separate=False, embed_bgm=True, instrument='D:/videotrans/tmp/22188/2434f1fe9b/instrument.wav', vocal='D:/videotrans/tmp/22188/2434f1fe9b/vocal.wav', clear_cache=True, background_music='', subtitle_type=4, only_out_mp4=False, recogn2pass=False, output_srt=2, copysrt_rawvideo=False, loop_backaudio=1, backaudio_volume=0.8)


=
system:Windows-10-10.0.22631-SP0
version:v4.02
frozen:True
language:zh
root_dir:D:/videotrans

1 Replies

这是由于 Qwen-ASR(本地) 模型在加载上下文(context)时出现异常,常见于模型文件不完整或音频预处理阶段出错。Batch size mismatch: audio=8, context=0 表示 ASR 将音频切分为 8 个片段,但未能正确生成对应的上下文数据。

解决方案:

  1. 强制重新下载模型:删除 软件目录/models/ 下的 qwen-asr 相关文件夹,然后重启软件重新执行识别任务,自动下载完整模型。
  2. 检查音频质量:确保输入视频/音频中的人声清晰、无明显静音或噪声干扰。可尝试在主界面点击“设置更多参数”后勾选“降噪”或“分离人声背景声”。
  3. 降低模型尺寸:若显存不足,在语音识别渠道选择中将模型从 1.7B 切换到更小的参数版本(如默认),或改用 faster-whisper(本地)+large-v3 替代。
  4. 切换 ASR 渠道:中文视频建议优先使用豆包语音大模型极速版阿里百炼Qwen3-ASR(需要 API Key),稳定性和精度更高。

若以上仍无效,请提供 logs/ 目录下最新的完整日志文件供进一步分析。

请查阅相关文档:

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. Dondate: ko-fi.com/jianchang512

Related resource