#8676 Tensor.item() cannot be called on meta tensors,Traceback (most recent call last): File

81.28**5 Posted at: 52 minutes ago

Tensor.item() cannot be called on meta tensors,Traceback (most recent call last):
File "videotrans\process\qwen_tts.py", line 91, in qwen3tts_fun
File "D:\pyvideotrans\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "qwen_tts\inference\qwen3_tts_model.py", line 829, in generate_custom_voice

talker_codes_list, _ = self.model.generate(

File "D:\pyvideotrans\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "qwen_tts\core\models\modeling_qwen3_tts.py", line 2272, in generate

talker_result = self.talker.generate(

File "D:\pyvideotrans\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "D:\pyvideotrans\_internal\transformers4576\generation\utils.py", line 2566, in generate

result = decoding_method(

File "D:\pyvideotrans\_internal\transformers4576\generation\utils.py", line 2789, i
......
789, in _sample

outputs = model_forward(**model_inputs, return_dict=True)

File "D:\pyvideotrans\_internal\torch\nn\modules\module.py", line 1751, in _wrapped_call_impl

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

File "D:\pyvideotrans\_internal\torch\nn\modules\module.py", line 1762, in _call_impl

return forward_call(*args, **kwargs)

File "D:\pyvideotrans\_internal\transformers4576\utils\generic.py", line 918, in wrapper

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

File "qwen_tts\core\models\modeling_qwen3_tts.py", line 1671, in forward

predictor_result = self.code_predictor.generate(

File "D:\pyvideotrans\_internal\torch\utils\_contextlib.py", line 116, in decorate_context

return func(*args, **kwargs)

File "D:\pyvideotrans\_internal\transformers4576\generation\utils.py", line 2566, in generate

result = decoding_method(

File "D:\pyvideotrans\_internal\transformers4576\generation\utils.py", line 2781, in _sample

while self._has_unfinished_sequences(this_peer_finished, synced_gpus, device=input_ids.device):

File "D:\pyvideotrans\_internal\transformers4576\generation\utils.py", line 2599, in _has_unfinished_sequences

elif this_peer_finished:

File "D:\pyvideotrans\_internal\torch\_meta_registrations.py", line 7088, in meta_local_scalar_dense

raise RuntimeError("Tensor.item() cannot be called on meta tensors")

RuntimeError: Tensor.item() cannot be called on meta tensors

cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: G:/海外社媒/天珠介绍.mp4,
输出结果保存到文件夹: G:/海外社媒/_video_out/天珠介绍-mp4,
临时文件夹: D:/pyvideotrans/tmp/10676/b61c18399e
已选 清理已存在
未启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), tiny, 发音语言: 简体中文, 断句方式:默认断句
翻译渠道:Google(免费),原始语言:简体中文,目标语言:英语, 未选 发送完整字幕
配音渠道:Qwen3-TTS(内置), 角色:Ryan, 配音语言:英语, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: 嵌入硬字幕
代理地址:http://127.0.0.1:26800
video_duration_ms=270067


=
system:Windows-10-10.0.19045-SP0
version:v4.14
frozen:True
language:zh_CN
root_dir:D:/pyvideotrans

1 Replies

#1 DeepSeek reply at 52 minutes ago

这是 Qwen3-TTS(内置) 本地模型的加载/运行问题:模型权重被放到了 meta 设备(未真正载入内存或显存),推理时 transformers 的采样循环调用 .item() 取值,于是直接抛出 Tensor.item() cannot be called on meta tensors。这与语音识别、翻译无关,属于配音环节的本地推理环境问题。知识库中没有该报错的专门条目,下面列出排查步骤。

排查步骤:

  1. 先升级到最新版。当前为 v4.14,建议升级到 v4.18(v4.13 起因本地配音渠道放弃 8 位量化,就是为了规避这类环境兼容问题)。
  2. 取消 8 位量化。打开 菜单 → 工具/选项 → 高级选项 → 通用设置,确认不勾选 为qwen3-tts使用8位量化。CPU 环境下做 8bit 量化极易导致权重无法落地(表现为 meta tensor)。
  3. 确认不要动过设备强制选项。同一区域若曾修改 强制指定重型任务运行设备,请改回默认值;该选项被误设会导致模型被放到非实际设备上。
  4. 检查内存/显存是否够用。Qwen3-TTS 本地推理占用较大。若你是 N 卡,按文档装好 CUDA 12.8 + cuDNN 9.11 后勾选主界面 CUDA加速 再重试;若是纯 CPU,请关掉其它占内存程序后再试。
  5. 检查模型文件是否下载完整。确认以下两个目录内文件齐全,若有缺失或体积异常,删除整个文件夹后重新下载:

    • 软件目录/models/models--Qwen--Qwen3-TTS-12Hz-0.6B-Base
    • 软件目录/models/models--Qwen--Qwen3-TTS-12Hz-0.6B-CustomVoice
  6. 应急方案:配音渠道临时改用 Edge-TTS(免费),先把成品流程跑通;Qwen3-TTS 的问题单独排查。

若以上操作后仍报同样错误,请提供 D:/pyvideotrans/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