Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] xtts_v2, AttributeError: 'TTS' object has no attribute 'speakers' #3742

Closed
chigkim opened this issue May 16, 2024 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@chigkim
Copy link

chigkim commented May 16, 2024

Describe the bug

If I run tts.speakers after loading xtts_v2, it throws an error: 'TTS' object has no attribute 'speakers'.

To Reproduce

import torch
from TTS.api import TTS
device = "cuda" if torch.cuda.is_available() else "cpu"
model = "tts_models/multilingual/multi-dataset/xtts_v2"
tts = TTS(model).to(device)
tts.speakers

Expected behavior

It should list all the speaker names.

Logs

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>.venv\Lib\site-packages\torch\nn\modules\module.py", line 1709, in __getattr__
    raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'TTS' object has no attribute 'speakers'

Environment

{
    "CUDA": {
        "GPU": [],
        "available": false,
        "version": null
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "2.3.0+cpu",
        "TTS": "0.22.0",
        "numpy": "1.26.4"
    },
    "System": {
        "OS": "Windows",
        "architecture": [
            "64bit",
            "WindowsPE"
        ],
        "processor": "Intel64 Family 6 Model 94 Stepping 3, GenuineIntel",
        "python": "3.11.9",
        "version": "10.0.19045"
    }
}

Additional context

Other multi speaker models like vctk/vits work fine using the same method.

@chigkim chigkim added the bug Something isn't working label May 16, 2024
@eginhard
Copy link
Contributor

This is fixed by eginhard#8 in our fork, available via pip install coqui-tts

@chigkim
Copy link
Author

chigkim commented May 16, 2024

Thanks@eginhard! Had no idea this repo was abandoned.

@chigkim chigkim closed this as completed May 16, 2024
@jamesob
Copy link

jamesob commented Jun 1, 2024

Thanks @eginhard. This repo should probably be marked as read-only/archive by its owners.

@Asrithapenmetsa
Copy link

Hi, @chigkim
Have you finetuned the vits model with your own dataset?
Because I am encountering this error AttributeError: 'TTS' object has no attribute 'get_model' while I am tryng to finetune the model?

@chigkim
Copy link
Author

chigkim commented Jul 26, 2024

It's a bug, and it's fixed in another fork.
https://github.com/idiap/coqui-ai-TTS

@eginhard
Copy link
Contributor

@Asrithapenmetsa Placing code between triple backticks would make it easier to read... Could you also share the full error trace, not just the last line?

@eginhard
Copy link
Contributor

Your error message

    model = TTS('tts_models/en/ljspeech/vits').to(device)
NameError: name 'device' is not defined

tells you that the variable device is not defined. So add a line that defines it before, e.g.

device = "cuda" if torch.cuda.is_available() else "cpu"

@Asrithapenmetsa
Copy link

Asrithapenmetsa commented Jul 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants