Not working

#9
by Hans-Peter-Gustaf - opened

I downloaded the repo from github and then I created the script in the project folder.
First I installed TTS with pip install TTS.

from TTS.tts.configs.xtts_config import XttsConfig
from TTS.tts.models.xtts import Xtts

config = XttsConfig()
config.load_json("config.json")
model = Xtts.init_from_config(config)
model.load_checkpoint(config, checkpoint_dir="", eval=True)
model.cuda()

outputs = model.synthesize(
"It took me quite a long time to develop a voice and now that I have it I am not going to be silent.",
config,
speaker_wav="out.wav",
gpt_cond_len=3,
language="en",
)

But on executing the script with python script.py I get:

C:\Users\Edd\AppData\Local\Programs\Python\Python310\lib\site-packages\torchaudio\compliance\kaldi.py:22: UserWarning: Failed to initialize NumPy: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the T
roubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem . (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.)
EPSILON = torch.tensor(torch.finfo(torch.float).eps)
Traceback (most recent call last):
File "A:\AI\Text-To-Speech\coqui\XTTS-v1\test.py", line 8, in
model.cuda()
File "C:\Users\Edd\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 905, in cuda
return self._apply(lambda t: t.cuda(device))
File "C:\Users\Edd\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply
module._apply(fn)
File "C:\Users\Edd\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply
module._apply(fn)
File "C:\Users\Edd\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 797, in _apply
module._apply(fn)
File "C:\Users\Edd\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 820, in _apply
param_applied = fn(param)
File "C:\Users\Edd\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 905, in
return self.apply(lambda t: t.cuda(device))
File "C:\Users\Edd\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda_init
.py", line 239, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

Even if you try to run it on cpu, it gives the same error related to Cuda. Maybe in your case try updating numpy to 1.23.4 and transformers to the latest version

https://huggingface.co/coqui/XTTS-v1/discussions/4 if you find another fix please update me as I am having the same problem

Python310\lib\site-packages\torchaudio\compliance\kaldi.py:22: UserWarning: Failed to initialize NumPy: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the T
...
File "C:\Users\Edd\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda_init.py", line 239, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

If you are trying to run on CPU comment this line on code, if you do not have CUDA GPU or torch with CPU only you will get above error.
model.cuda()

You seem to have Python 3.10 , but likely have torch with CPU pre installed, as numpy warning comes from torchaudio/compliance/kaldi

Check if your torch supports cuda (cuda version should be printed)

python -c "import torch;print('torch version:',torch.__version__);print('torch cuda version:',torch.version.cuda)"
torch version: 2.0.1+cu118
torch cuda version: 11.8"

If it is installed check numpy version and update to 1.22.x if necessary `

python -c "import numpy;print('numpy version:',numpy.__version__)"
numpy version: 1.22.0
pip install --upgrade numpy

If it is not Cuda torch you need to reinstall cuda version like (following will install/upgrade latest torch with cuda 11.8)
python -m pip install --upgrade torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
For previous versions
https://pytorch.org/get-started/previous-versions/

Coqui.ai org

Please update your TTS==0.17.8 should fix these issues plus speed boosted vocoder

gorkemgoknar changed discussion status to closed

Please update your TTS==0.17.8 should fix these issues plus speed boosted vocoder

Yeah it's working but the issue is the output of xtts is most of the times the same input audio all over again instead of new cloned speech. Sometimes the input audio gets mixed with words from the input text in the output audio generated.

Sign up or log in to comment