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

183.13**4 Posted at: 55 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
......
utils.py", line 2789, 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/9452/b61c18399e
已选 清理已存在
未启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), tiny, 发音语言: 简体中文, 断句方式:默认断句
翻译渠道:Google(免费),原始语言:简体中文,目标语言:英语, 未选 发送完整字幕
配音渠道:Qwen3-TTS(内置), 角色:Vivian, 配音语言:英语, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
字幕: 不嵌入字幕
已选 仅输出mp4
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 55 minutes ago

这是 Qwen3-TTS(内置) 本地模型在加载/推理时权重未真正落到显存或内存上(被 lazy 或量化方式置为 meta 设备)导致的,属于模型加载层面异常,与视频本身及翻译环节无关。同一原因也会连带引发其他渠道报错,因此需按以下顺序排查:

  1. 取消 8 位量化:进入 菜单 → 工具/选项 → 高级选项 → 通用设置,取消勾选 为qwen3-tts使用8位量化。该量化在纯 CPU 或部分环境下会令权重停在 meta 设备,从而抛出 Tensor.item() cannot be called on meta tensors。
  2. 确认模型已完整下载:检查 D:/pyvideotrans/models/ 下是否存在 models--Qwen--Qwen3-TTS-12Hz-0.6B-Base 与 models--Qwen--Qwen3-TTS-12Hz-0.6B-CustomVoice 两个目录,且目录内文件齐全(model.safetensors 等未缺失、未被浏览器改名成 model(2).safetensors)。缺失或不完整时先删除该目录,再重新运行以触发重新下载;下载失败可手动下载后覆盖到对应目录。
  3. 显存/内存不足也会导致加载不完整:你的配置为 未启用CUDA加速,但 Qwen3-TTS 属于「优先使用 GPU」的渠道,只要检测到 CUDA 可用仍会尝试上卡。若显卡显存偏小,请在 高级选项 → 通用设置 → 强制指定重型任务运行设备 改为 CPU,或关闭其他占用显存的程序后重试。
  4. 升级版本:你当前为 v4.14,Qwen3-TTS 相关加载与量化逻辑后续版本有多次修复,建议更新补丁包或完整包(需覆盖 sp.exe、_internal、videotrans 全部内容,并清理 _internal 下所有 __pycache__)后重试。
  5. 若仅需尽快出片,可先将配音渠道临时改为 Edge-TTS(免费),配音角色选英语女声(如 en-US-JennyNeural),其余设置不变。

若按上述操作后仍报同一错误,请提供软件安装目录下 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