#8595 Audio features and audio tokens do not match, tokens: 756, features: 756:Traceback (most recent call last): File

212.107**7 Posted at: 2 hours ago

Audio features and audio tokens do not match, tokens: 756, features: 756:Traceback (most recent call last):
File "videotrans\process\stt_qwen.py", line 83, in qwen3asr_fun
File "F:\Program Files (x86)\pyvideotrans\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "F:\Program Files (x86)\pyvideotrans\_internal\transformers\generation\utils.py", line 2645, in generate

result = decoding_method(

File "F:\Program Files (x86)\pyvideotrans\_internal\transformers\generation\utils.py", line 2845, in _sample

outputs = self._prefill(

File "F:\Program Files (x86)\pyvideotrans\_internal\transformers\generation\utils.py", line 3896, in _prefill

return self(**model_inputs, return_dict=True)

File "F:\Program Files (x86)\pyvideotrans\_internal\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl

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

File "F:\Program Files (x86)\pyvideotrans\_internal\torch\nn\m
......
dule.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "F:\Program Files (x86)\pyvideotrans\_internal\transformers\utils\generic.py", line 911, in wrapper

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

File "F:\Program Files (x86)\pyvideotrans\_internal\transformers\models\qwen3_asr\modeling_qwen3_asr.py", line 552, in forward

special_audio_mask = self.get_placeholder_mask(

File "F:\Program Files (x86)\pyvideotrans\_internal\transformers\models\qwen3_asr\modeling_qwen3_asr.py", line 520, in get_placeholder_mask

torch_compilable_check(

File "F:\Program Files (x86)\pyvideotrans\_internal\transformers\utils\import_utils.py", line 1633, in torch_compilable_check

torch._check_with(error_type, cond, msg_callable)

File "F:\Program Files (x86)\pyvideotrans\_internal\torch\__init__.py", line 1642, in _check_with

raise error_type(message_evaluated)

ValueError: Audio features and audio tokens do not match, tokens: 756, features: 756

trk=[TransCreate]: uuid='8a00929af7', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: D:/Downloads/Video/Real-757-pilot-SnapYT.App.mp4,
输出结果保存到文件夹: D:/Downloads/Video/Real-757-pilot-SnapYT.App-mp4,
临时文件夹: F:/Program Files (x86)/pyvideotrans/tmp/14008/8a00929af7
未选 清理已存在
已启用CUDA加速
语音识别:Qwen-ASR(内置), 0.6B, 发音语言: 英语, LLM纠错,
翻译渠道:DeepSeek,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕, settings.get('trans_thread')=5, settings.get('aitrans_thread')=40
配音渠道:Edge-TTS(免费), 角色:Yunjian(Male/CN), 配音语言:简体中文
已选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: 不嵌入字幕 , precent=4, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=True, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='', should_recogn2=True, do_diarize=True
video_duration_ms=4712650


=
system:Windows-10-10.0.26300-SP0
version:v4.17
frozen:True
language:zh_CN
root_dir:F:/Program Files (x86)/pyvideotrans

1 Replies

#1 DeepSeek reply at 2 hours ago

该报错发生在 transformers 内部的 modeling_qwen3_asr.py 占位符校验环节(tokens 与 features 数值相同却仍判定不匹配),属于 Qwen-ASR 内置模型与软件内置 transformers 版本不匹配,或模型文件下载不完整/文件混入旧版本残留导致的校验异常,而非显存或音频本身问题。另外你当前安装在 F:\Program Files (x86)\pyvideotrans,该路径含空格、括号且属受保护目录,也是常见报错诱因。

处理步骤(按顺序尝试):

  1. 迁移目录:将整个软件文件夹移动到浅层纯英文数字路径,例如 F:\pyvideotrans,再从新目录启动 sp.exe,不要放在 Program Files 系列目录下。
  2. 清理 Qwen-ASR 模型残留:删除 软件目录/models/models--Qwen--Qwen3-ASR-0.6B-hf(以及 models--Qwen--Qwen3-ASR-1.7B-hf,若存在),并搜索删除软件目录下所有 __pycache__ 文件夹后重新启动,让软件重新完整下载模型。
    手动下载地址:https://huggingface.co/Qwen/Qwen3-ASR-0.6B-hf/tree/main ,存放位置:软件目录/models/models--Qwen--Qwen3-ASR-0.6B-hf。若下载文件被浏览器改名(如 model(2).safetensors),必须改回原名。
  3. 若升级过补丁包,请确认是按完整覆盖方式更新(sp.exe、_internal、videotrans 全部覆盖),仅覆盖 sp.exe 会造成内部依赖版本不一致,从而出现此类版本校验错误。
  4. 临时规避:本视频发音语言为英语,可直接改用 faster-whisper(内置) + large-v3 或 large-v3-turbo 模型,识别效果更稳,无需 Qwen-ASR。
  5. 以上均无效时,请提供软件安装目录下 logs/ 文件夹中最新的日志文件,复制底部约 30 行报错信息(含完整异常链)以便分析是否为内置 transformers 版本缺陷。

请查阅相关文档:

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