Text-to-Speech
Safetensors
English
Chinese

NotImplementedError: Output channels > 65536 not supported at the MPS device

#8
by Hiltter - opened

NotImplementedError: Output channels > 65536 not supported at the MPS device. As a temporary fix, you can set the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1 to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.

2025-03-13 02:44:25,535 - INFO - Using model from: pretrained_models/Spark-TTS-0.5B
2025-03-13 02:44:25,535 - INFO - Saving audio to: example/results
2025-03-13 02:44:25,546 - INFO - Using MPS device: mps:0
/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/utils/weight_norm.py:143: FutureWarning: `torch.nn.utils.weight_norm` is deprecated in favor of `torch.nn.utils.parametrizations.weight_norm`.
  WeightNorm.apply(module, name, dim)
Missing tensor: mel_transformer.spectrogram.window
Missing tensor: mel_transformer.mel_scale.fb
2025-03-13 02:44:31,878 - INFO - Starting inference...
Setting `pad_token_id` to `eos_token_id`:None for open-end generation.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/xxx/code/Ai/Spark-TTS/cli/inference.py", line 116, in <module>
    run_tts(args)
  File "/Users/xxx/code/Ai/Spark-TTS/cli/inference.py", line 97, in run_tts
    wav = model.inference(
          ^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/code/Ai/Spark-TTS/cli/SparkTTS.py", line 231, in inference
    wav = self.audio_tokenizer.detokenize(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/code/Ai/Spark-TTS/sparktts/models/audio_tokenizer.py", line 145, in detokenize
    wav_rec = self.model.detokenize(semantic_tokens, global_tokens)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/code/Ai/Spark-TTS/sparktts/models/bicodec.py", line 187, in detokenize
    wav_recon = self.decoder(x)
                ^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/code/Ai/Spark-TTS/sparktts/modules/encoder_decoder/wave_generator.py", line 88, in forward
    return self.model(x)
           ^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/container.py", line 250, in forward
    input = module(input)
            ^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/code/Ai/Spark-TTS/sparktts/modules/encoder_decoder/wave_generator.py", line 53, in forward
    return self.block(x)
           ^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/container.py", line 250, in forward
    input = module(input)
            ^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/code/Ai/Spark-TTS/sparktts/modules/blocks/layers.py", line 63, in forward
    y = self.block(x)
        ^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/container.py", line 250, in forward
    input = module(input)
            ^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1736, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1747, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/conv.py", line 375, in forward
    return self._conv_forward(input, self.weight, self.bias)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xxx/anaconda3/envs/sparktts/lib/python3.12/site-packages/torch/nn/modules/conv.py", line 370, in _conv_forward
    return F.conv1d(
           ^^^^^^^^^
NotImplementedError: Output channels > 65536 not supported at the MPS device. As a temporary fix, you can set the environment variable `PYTORCH_ENABLE_MPS_FALLBACK=1` to use the CPU as a fallback for this op. WARNING: this will be slower than running natively on MPS.

Use these requirements. Solution from euzkadie on git.

einops==0.8.1
einx==0.3.0
numpy==1.26.4
pandas==2.2.0
omegaconf==2.3.0
packaging==24.2
safetensors==0.5.2
soundfile==0.12.1
soxr==0.5.0.post1
torch==2.6.0
torchaudio==2.6.0
tqdm==4.66.5
transformers==4.46.2
gradio==5.18.0

Your need to confirm your account before you can post a new comment.

Sign up or log in to comment