#6912 语音识别阶段出错[Huggingface_ASR(内置)] The expanded size of the tensor (3092) must match the existing size (3000) at non-singleto

182.147.**2 Posted at: 1 hour ago

语音识别阶段出错[Huggingface_ASR(内置)] The expanded size of the tensor (3092) must match the existing size (3000) at non-singleton dimension 1. Target sizes: [128, 3092]. Tensor sizes: [128, 3000]:Traceback (most recent call last):
File "videotrans\process\stt_pipe.py", line 94, in pipe_asr
File "D:\win-pyvideotrans-v4.11\_internal\transformers\pipelines\automatic_speech_recognition.py", line 244, in call

return super().__call__(inputs, **kwargs)

File "D:\win-pyvideotrans-v4.11\_internal\transformers\pipelines\base.py", line 1245, in call

outputs = list(final_iterator)

File "D:\win-pyvideotrans-v4.11\_internal\transformers\pipelines\pt_utils.py", line 126, in next

item = next(self.iterator)

File "D:\win-pyvideotrans-v4.11\_internal\transformers\pipelines\pt_utils.py", line 271, in next

processed = self.infer(next(self.iterator), **self.params)

File "D:\win-pyvideotrans-v4.11\_internal\torch\utils\data\dataloader.py", line 733, in next
......
rmers\pipelines\automatic_speech_recognition.py", line 244, in call

return super().__call__(inputs, **kwargs)

File "D:\win-pyvideotrans-v4.11\_internal\transformers\pipelines\base.py", line 1245, in call

outputs = list(final_iterator)

File "D:\win-pyvideotrans-v4.11\_internal\transformers\pipelines\pt_utils.py", line 126, in next

item = next(self.iterator)

File "D:\win-pyvideotrans-v4.11\_internal\transformers\pipelines\pt_utils.py", line 271, in next

processed = self.infer(next(self.iterator), **self.params)

File "D:\win-pyvideotrans-v4.11\_internal\torch\utils\data\dataloader.py", line 733, in next

data = self._next_data()

File "D:\win-pyvideotrans-v4.11\_internal\torch\utils\data\dataloader.py", line 789, in _next_data

data = self._dataset_fetcher.fetch(index)  # may raise StopIteration

File "D:\win-pyvideotrans-v4.11\_internal\torch\utils\data\_utils\fetch.py", line 43, in fetch

return self.collate_fn(data)

File "D:\win-pyvideotrans-v4.11\_internal\transformers\pipelines\base.py", line 173, in inner

padded[key] = _pad(items, key, _padding_value, padding_side)

File "D:\win-pyvideotrans-v4.11\_internal\transformers\pipelines\base.py", line 109, in _pad

tensor[i, : len(item[key][0])] = item[key][0]

RuntimeError: The expanded size of the tensor (3092) must match the existing size (3000) at non-singleton dimension 1. Target sizes: [128, 3092]. Tensor sizes: [128, 3000]
[SpeechToText]语音转录: self.out_format='srt',self.copysrt_rawvideo=True,self.spk_insert=False
[TaskCfgSTT]
原始输入文件名: F:/超爱/START破解中文/kks11.cc@ALDN-600J/JN10395.mp4,
输出结果保存到文件夹: D:/BaiduNetdiskDownload/win-pyvideotrans-v4.11/output/recogn,
临时文件夹: D:/win-pyvideotrans-v4.11/tmp/6768/d3cb1601ca
已启用CUDA加速
未选 降噪
语音识别:Huggingface_ASR(内置), kotoba-tech/kotoba-whisper-v2.0 断句方式:默认断句
发音语言:ja
未选 降噪


=
system:Windows-10-10.0.19045-SP0
version:v4.11
frozen:True
language:zh
root_dir:D:/win-pyvideotrans-v4.11

1 Replies

#1 DeepSeek reply at 1 hour ago

核心原因是 Huggingface_ASR(内置) 渠道中的 kotoba-tech/kotoba-whisper-v2.0 模型与当前软件内置的 transformers 管道存在兼容性问题,当输入音频特征长度与模型期望长度不一致时,会触发张量填充维度错误(3092 vs 3000)。

解决方案(按优先级)

  1. 更换为其他日语识别模型:在 Huggingface_ASR 渠道的模型列表中选择 reazon-research/japanese-wav2vec2-large-rs35kh,或改用支持日语的 openai/whisper(内置)large-v3 模型。该错误仅针对 kotoba-whisper-v2.0,换用后即可规避。
  2. 若坚持使用该模型:尝试进入 菜单 → 工具 → 高级选项 → 语音识别参数,将 Whisper预分割音频? 选中,并将 最长语音持续(秒) 设为 10,最短语音持续(毫秒) 设为 3000,减少超长音频切片导致的填充溢出。
  3. 确认模型文件完整:若自动下载曾失败,模型可能损坏。删除 软件目录/models/models--kotoba-tech--kotoba-whisper-v2.0 后重新下载,或手动下载覆盖,地址:https://huggingface.co/kotoba-tech/kotoba-whisper-v2.0/tree/main

若上述操作仍报错,请提供 logs/ 目录下最新日志文件底部约30行内容,以便进一步分析。

请查阅相关文档:

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