TTS
TTS copied to clipboard
'TTS' object has no attribute 'is_multi_speaker'
Describe the bug
Traceback (most recent call last):
File "/home/house365ai/xxm/TTS/demo.py", line 16, in
To Reproduce
'TTS' object has no attribute 'is_multi_speaker'
Expected behavior
No response
Logs
'TTS' object has no attribute 'is_multi_speaker'
Environment
'TTS' object has no attribute 'is_multi_speaker'
Additional context
'TTS' object has no attribute 'is_multi_speaker'
after finetune xtts2 also
It's missing proper context and steps to reproduce. Copy pasting 'TTS' object has no attribute 'is_multi_speaker'
doesn't help.
Traceback (most recent call last):
File "/root/tutorials/demos/xtts_infer_demo.py", line 10, in <module>
tts.tts_to_file(text="It took me quite a long time to develop a voice, and now that I have it I'm not going to be silent.",
File "/root/miniconda3/envs/tts/lib/python3.9/site-packages/TTS/api.py", line 391, in tts_to_file
self._check_arguments(speaker=speaker, language=language, speaker_wav=speaker_wav, **kwargs)
File "/root/miniconda3/envs/tts/lib/python3.9/site-packages/TTS/api.py", line 235, in _check_arguments
if self.is_multi_speaker and (speaker is None and speaker_wav is None):
File "/root/miniconda3/envs/tts/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1695, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'TTS' object has no attribute 'is_multi_speaker'
TTS==0.21.1 torch==2.1.1 torchaudio==2.1.1 numpy==1.22.0
You still didn't share the inference code.
@WeberJulian Can reproduce on M1 MacBook Pro (MacOS Sonoma 14.1.1 23B81) with Python 3.11.5, using a slight modification of the example code in the readme:
import torch
from TTS.TTS.api import TTS
OUTPUT_PATH = "tacotron2.wav"
device = "mps" #if torch.backends.mps.is_available() else "cuda" if torch.cuda.is_available() else "cpu"
# Init TTS with the target model name
tts = TTS(model_name="TTS/TTS/tts/models/tacotron2.py", progress_bar=True).to(device)
# Run TTS
tts.tts_to_file(text="Hello!", file_path=OUTPUT_PATH)
The code outputs the following:
/Users/jtohahn/Documents/tts-test/.venv/bin/python /Users/jtohahn/Documents/tts-test/multispeaker.py
Traceback (most recent call last):
File "/Users/jtohahn/Documents/tts-test/multispeaker.py", line 11, in <module>
tts.tts_to_file(text="Hello!", file_path=OUTPUT_PATH)
File "/Users/jtohahn/Documents/tts-test/TTS/TTS/api.py", line 391, in tts_to_file
self._check_arguments(speaker=speaker, language=language, speaker_wav=speaker_wav, **kwargs)
File "/Users/jtohahn/Documents/tts-test/TTS/TTS/api.py", line 235, in _check_arguments
if self.is_multi_speaker and (speaker is None and speaker_wav is None):
^^^^^^^^^^^^^^^^^^^^^
File "/Users/jtohahn/Documents/tts-test/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1695, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'TTS' object has no attribute 'is_multi_speaker'
The code also fails when using device = "cpu"
instead of device = "mps"
.
TTS==0.21.1 torch==2.1.1 numpy==1.26.2 torchaudio==2.1.1
@bigcash's solution on #3187 works for me.
I had model_name
set as TTS/TTS/tts/models/tacotron2.py
, while it should be tts_models/en/ljspeech/tacotron2-DDC
.
You can find a list of model names by running tts --list_models
in a shell.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.