6
在运行:wavs = chat.infer(texts, use_decoder=True)
时报了如下错误:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Cell In[5], [line 1](vscode-notebook-cell:?execution_count=5&line=1)
----> [1](vscode-notebook-cell:?execution_count=5&line=1) wavs = chat.infer(texts, use_decoder=True)
File ~/git/ChatTTS/ChatTTS/core.py:153, in Chat.infer(self, text, skip_refine_text, refine_text_only, params_refine_text, params_infer_code, use_decoder)
[150](https://file+.vscode-resource.vscode-cdn.net/Users/zhaohui/git/ChatTTS/~/git/ChatTTS/ChatTTS/core.py:150) else:
[151](https://file+.vscode-resource.vscode-cdn.net/Users/zhaohui/git/ChatTTS/~/git/ChatTTS/ChatTTS/core.py:151) mel_spec = [self.pretrain_models['dvae'](i[None].permute(0,2,1)) for i in result['ids']]
--> [153](https://file+.vscode-resource.vscode-cdn.net/Users/zhaohui/git/ChatTTS/~/git/ChatTTS/ChatTTS/core.py:153) wav = [self.pretrain_models['vocos'].decode(i).cpu().numpy() for i in mel_spec]
[155](https://file+.vscode-resource.vscode-cdn.net/Users/zhaohui/git/ChatTTS/~/git/ChatTTS/ChatTTS/core.py:155) return wav
File ~/git/ChatTTS/ChatTTS/core.py:153, in <listcomp>(.0)
[150](https://file+.vscode-resource.vscode-cdn.net/Users/zhaohui/git/ChatTTS/~/git/ChatTTS/ChatTTS/core.py:150) else:
[151](https://file+.vscode-resource.vscode-cdn.net/Users/zhaohui/git/ChatTTS/~/git/ChatTTS/ChatTTS/core.py:151) mel_spec = [self.pretrain_models['dvae'](i[None].permute(0,2,1)) for i in result['ids']]
--> [153](https://file+.vscode-resource.vscode-cdn.net/Users/zhaohui/git/ChatTTS/~/git/ChatTTS/ChatTTS/core.py:153) wav = [self.pretrain_models['vocos'].decode(i).cpu().numpy() for i in mel_spec]
[155](https://file+.vscode-resource.vscode-cdn.net/Users/zhaohui/git/ChatTTS/~/git/ChatTTS/ChatTTS/core.py:155) return wav
File /usr/local/lib/python3.11/site-packages/torch/utils/_contextlib.py:115, in context_decorator.<locals>.decorate_context(*args, **kwargs)
[112](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/torch/utils/_contextlib.py:112) @functools.wraps(func)
[113](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/torch/utils/_contextlib.py:113) def decorate_context(*args, **kwargs):
[114](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/torch/utils/_contextlib.py:114) with ctx_factory():
--> [115](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/torch/utils/_contextlib.py:115) return func(*args, **kwargs)
File /usr/local/lib/python3.11/site-packages/vocos/pretrained.py:113, in Vocos.decode(self, features_input, **kwargs)
[101](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/vocos/pretrained.py:101) """
...
---> [67](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/vocos/heads.py:67) S = mag * (x + 1j * y)
[68](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/vocos/heads.py:68) audio = self.istft(S)
[69](https://file+.vscode-resource.vscode-cdn.net/usr/local/lib/python3.11/site-packages/vocos/heads.py:69) return audio
RuntimeError: c10::isComplexType(input.scalar_type()) && c10::isComplexType(other.scalar_type()) INTERNAL ASSERT FAILED at "/Users/runner/work/pytorch/pytorch/pytorch/aten/src/ATen/native/mps/operations/BinaryKernel.mm":340, please report a bug to PyTorch.
此外在运行期间一直有warning
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] Traceback (most recent call last):
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 727, in _convert_frame
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] result = inner_convert(frame, cache_entry, hooks, frame_state)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 383, in _convert_frame_assert
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] compiled_product = _compile(
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 646, in _compile
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] guarded_code = compile_inner(code, one_graph, hooks, transform)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/utils.py", line 244, in time_wrapper
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] r = func(*args, **kwargs)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 562, in compile_inner
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] out_code = transform_code_object(code, transform)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/bytecode_transformation.py", line 1033, in transform_code_object
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] transformations(instructions, code_options)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 151, in _fn
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] return fn(*args, **kwargs)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py", line 527, in transform
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] tracer.run()
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2128, in run
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] super().run()
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 818, in run
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] and self.step()
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 781, in step
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] getattr(self, inst.opname)(inst)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py", line 2243, in RETURN_VALUE
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] self.output.compile_subgraph(
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/output_graph.py", line 919, in compile_subgraph
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] self.compile_and_call_fx_graph(tx, list(reversed(stack_values)), root)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 81, in inner
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] return func(*args, **kwds)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/output_graph.py", line 1087, in compile_and_call_fx_graph
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] compiled_fn = self.call_user_compiler(gm)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/utils.py", line 244, in time_wrapper
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] r = func(*args, **kwargs)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/output_graph.py", line 1159, in call_user_compiler
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] raise BackendCompilerFailed(self.compiler_fn, e).with_traceback(
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/output_graph.py", line 1140, in call_user_compiler
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] compiled_fn = compiler_fn(gm, self.example_inputs())
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/repro/after_dynamo.py", line 117, in debug_wrapper
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] compiled_gm = compiler_fn(gm, example_inputs)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/__init__.py", line 1668, in __call__
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] return compile_fx(model_, inputs_, config_patches=self.config)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_inductor/compile_fx.py", line 1168, in compile_fx
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] return aot_autograd(
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/backends/common.py", line 55, in compiler_fn
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] cg = aot_module_simplified(gm, example_inputs, **kwargs)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_functorch/aot_autograd.py", line 887, in aot_module_simplified
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] compiled_fn = create_aot_dispatcher_function(
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/utils.py", line 244, in time_wrapper
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] r = func(*args, **kwargs)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_functorch/aot_autograd.py", line 600, in create_aot_dispatcher_function
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] compiled_fn = compiler_fn(flat_fn, fake_flat_args, aot_config, fw_metadata=fw_metadata)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_functorch/_aot_autograd/runtime_wrappers.py", line 425, in aot_wrapper_dedupe
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] return compiler_fn(flat_fn, leaf_flat_args, aot_config, fw_metadata=fw_metadata)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_functorch/_aot_autograd/runtime_wrappers.py", line 630, in aot_wrapper_synthetic_base
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] return compiler_fn(flat_fn, flat_args, aot_config, fw_metadata=fw_metadata)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_functorch/_aot_autograd/jit_compile_runtime_wrappers.py", line 97, in aot_dispatch_base
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] compiled_fw = compiler(fw_module, updated_flat_args)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/utils.py", line 244, in time_wrapper
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] r = func(*args, **kwargs)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_inductor/compile_fx.py", line 1100, in fw_compiler_base
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] return inner_compile(
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/repro/after_aot.py", line 83, in debug_wrapper
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] inner_compiled_fn = compiler_fn(gm, example_inputs)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_inductor/debug.py", line 305, in inner
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] return fn(*args, **kwargs)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 81, in inner
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] return func(*args, **kwds)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_inductor/compile_fx.py", line 320, in compile_fx_inner
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] compiled_graph = fx_codegen_and_compile(
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_inductor/compile_fx.py", line 550, in fx_codegen_and_compile
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] compiled_fn = graph.compile_to_fn()
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_inductor/graph.py", line 1116, in compile_to_fn
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] return self.compile_to_module().call
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_dynamo/utils.py", line 244, in time_wrapper
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] r = func(*args, **kwargs)
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_inductor/graph.py", line 1066, in compile_to_module
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] self.codegen_with_cpp_wrapper() if self.cpp_wrapper else self.codegen()
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_inductor/graph.py", line 1039, in codegen
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] self.init_wrapper_code()
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] File "/usr/local/lib/python3.11/site-packages/torch/_inductor/graph.py", line 993, in init_wrapper_code
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] assert wrapper_code_gen_cls is not None, f"Device {device_type} not supported"
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] torch._dynamo.exc.BackendCompilerFailed: backend='inductor' raised:
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] AssertionError: Device mps not supported
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING]
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING] Set TORCH_LOGS="+dynamo" and TORCHDYNAMO_VERBOSE=1 for more information
[2024-05-30 21:21:57,649] torch._dynamo.convert_frame: [WARNING]
基本信息
- pytorch:2.2.2
- Python: 3.11.4
- 设备:Apple M3 Pro
- OS:14.5 (23F79)