#9058 语音识别阶段出错[Qwen-ASR(内置)] Qwen3ASREncoder expects `padded_feature_length` to be a multiple of `n_window * 2` (100), but got

14.155**9 Posted at: 16 minutes ago

语音识别阶段出错[Qwen-ASR(内置)] Qwen3ASREncoder expects padded_feature_length to be a multiple of n_window * 2 (100), but got 6384.:Traceback (most recent call last):
File "videotrans\process\stt_qwen.py", line 93, in qwen3asr_fun
File "D:\Softwares\win-pyvideotrans-v4.20\_internal\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl

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

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\torch\nn\modules\module.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\transformers\utils\generic.py", line 911, in wrapper

output = func(self, *args, **kwargs)

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\transformers\modeling_layers.py", line 270, in forward

outputs: BaseModelOutputWithPast = getattr(self, self.base_model_prefix)(

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl

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

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\torch\nn\modules\module.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\transformers\utils\generic.py", line 911, in wrapper

output = func(self, *args, **kwargs)

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\transformers\models\qwen3_asr\modeling_qwen3_asr.py", line 549, in forward

audio_embeds = self.g

......
al\torch\nn\modules\module.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\transformers\utils\generic.py", line 911, in wrapper

output = func(self, *args, **kwargs)

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\transformers\models\qwen3_asr\modeling_qwen3_asr.py", line 549, in forward

audio_embeds = self.get_audio_features(input_features, input_features_mask, return_dict=True).pooler_output

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\transformers\utils\generic.py", line 911, in wrapper

output = func(self, *args, **kwargs)

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\transformers\models\qwen3_asr\modeling_qwen3_asr.py", line 494, in get_audio_features

audio_output = self.audio_tower(

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl

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

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\torch\nn\modules\module.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\transformers\utils\output_capturing.py", line 252, in wrapper

outputs = func(self, *args, **kwargs)

File "D:\Softwares\win-pyvideotrans-v4.20\_internal\transformers\models\qwen3_asr\modeling_qwen3_asr.py", line 383, in forward

raise ValueError(

ValueError: Qwen3ASREncoder expects padded_feature_length to be a multiple of n_window * 2 (100), but got 6384.

trk=翻译视频 单视频模式
选择音视频文件: C:/Users/zb116/Videos/2026-12-02 01-38-23.mp4,
输出目录: C:/Users/zb116/Videos/_video_out/2026-12-02 01-38-23-mp4,
self.cfg.cache_folder='D:/Softwares/win-pyvideotrans-v4.20/tmp/37284/10cd8362fd'
已选 清理已生成, 已选 启用硬件加速
语音识别:Qwen-ASR(内置), 1.7B, 发音语言: 简体中文
最长语音持续(秒): 5s
最短语音持续(毫秒): 3000ms
静音分割持续毫秒: 600ms
语音阈值: 0.45
选择VAD: silero
翻译渠道:Google(免费),发音语言:简体中文,目标语言:英语
传统翻译渠道每批字幕行数: 5
配音渠道:Qwen3-TTS(内置), 配音角色:clone, 目标语言:英语
Volume:+0%, Speed:+0%, 已选 配音加速, 未选 视频慢速
已选 移除每条字幕配音开头结尾静音缓冲
静音移除力度: default
嵌入硬字幕
中日韩字幕单行字符数:15, 其他语言字幕单行字符数:40
video duration:457350ms
video information:{'video_fps': 60.0, 'r_frame_rate': 60.0, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 2560, 'height': 1440, 'time': 457350, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}
self.cfg=TaskCfgVTT(uuid='10cd8362fd', name='C:/Users/zb116/Videos/2026-12-02 01-38-23.mp4', dirname='C:/Users/zb116/Videos', noextname='2026-12-02 01-38-23', basename='2026-12-02 01-38-23.mp4', ext='mp4', target_dir='C:/Users/zb116/Videos/_video_out/2026-12-02 01-38-23-mp4', cache_folder='D:/Softwares/win-pyvideotrans-v4.20/tmp/37284/10cd8362fd', is_cuda=True, source_language='简体中文', source_language_code='zh-cn', source_sub='C:/Users/zb116/Videos/_video_out/2026-12-02 01-38-23-mp4/zh-cn.srt', source_wav='D:/Softwares/win-pyvideotrans-v4.20/tmp/37284/10cd8362fd/zh-cn.wav', source_wav_output='C:/Users/zb116/Videos/_video_out/2026-12-02 01-38-23-mp4/zh-cn.m4a', target_language='英语', target_language_code='en', target_sub='C:/Users/zb116/Videos/_video_out/2026-12-02 01-38-23-mp4/en.srt', target_wav='D:/Softwares/win-pyvideotrans-v4.20/tmp/37284/10cd8362fd/target.wav', target_wav_output='C:/Users/zb116/Videos/_video_out/2026-12-02 01-38-23-mp4/en.m4a', translate_type=0, tts_type=4, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='clone', voice_autorate=True, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, tts_model_name=None, detect_language='zh', recogn_type=3, model_name='1.7B', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=False, fix_punc=0, app_mode='biaozhun', subtitle_language=None, targetdir_mp4='C:/Users/zb116/Videos/_video_out/2026-12-02 01-38-23-mp4/2026-12-02 01-38-23.mp4', novoice_mp4='D:/Softwares/win-pyvideotrans-v4.20/tmp/37284/10cd8362fd/novoice.mp4', is_separate=False, embed_bgm=True, instrument='D:/Softwares/win-pyvideotrans-v4.20/tmp/37284/10cd8362fd/instrument.wav', vocal='D:/Softwares/win-pyvideotrans-v4.20/tmp/37284/10cd8362fd/vocal.wav', clear_cache=True, background_music='', subtitle_type=1, only_out_mp4=False, recogn2pass=False, output_srt=0, copysrt_rawvideo=False, loop_backaudio=1, backaudio_volume=0.8, batch=False)
video_duration_ms=457350


=
system:Windows-10-10.0.26300-SP0
version:v4.20
frozen:True
language:zh_CN
root_dir:D:/Softwares/win-pyvideotrans-v4.20

1 Replies

#1 DeepSeek reply at 16 minutes ago

这是 Qwen3-ASR 内置模型(1.7B)在推理时对音频特征长度做强制校验失败:padded_feature_length 必须是 n_window*2(100)的整数倍,而实际得到 6384。该错误发生在 transformers 自带的 modeling_qwen3_asr.py 内部。知识库中没有这一具体报错的记录,通常说明:①本地 models--Qwen--Qwen3-ASR-1.7B-hf 目录里的模型文件、配置与软件内置的 transformers 版本不匹配(下载不完整、中断后残留、或混入了其他版本的 modeling/config 文件);②该视频切片长度命中了模型的边界校验缺陷。

可行处理(按顺序):

  1. 删除模型目录后重新拉取,排除下载残缺:
    删除 软件目录/models/models--Qwen--Qwen3-ASR-1.7B-hf,重新执行任务让它自动重下;若自动下载反复失败,按官方地址手动下载全部文件放回同名目录。
  2. 临时改试 0.6B 模型:主界面“语音识别”保持 Qwen-ASR(内置),模型下拉切换为 0.6B,看是否同样报错,以判断是否只与 1.7B 权重相关。
  3. 换渠道完成本次任务:中文识别建议改用 faster-whisper(内置) + large-v3(或 large-v3-turbo),或 Audio.cpp(fun_asr_nano / qwen3_asr / sense_asr),这些渠道不会触发该编码器校验。
  4. 若删除重下后仍报同一 got 6384,说明需要从程序层面修复,请提供日志以便定位。

请补充:软件安装目录下 logs/ 中最新日志文件底部约 30 行(含本错误前后的完整堆栈)。另外,你可尝试先将该视频改名并移动至浅层英文路径(如 D:/video1.mp4)后重试,以排除路径与长文件名因素。

请查阅相关文档:

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