BoltzmannEntropy / xtts2-ui

A User Interface for XTTS-2 Text-Based Voice Cloning using only 10 seconds of speech
MIT License
242 stars 40 forks source link

Unable to run on CPU #25

Closed GTP95 closed 5 months ago

GTP95 commented 5 months ago

Greetings,

I'm trying to run this project inside a Windows 11 VM (I know it's bad for performance, but I need to do some quick tests). As I don't have any Nvidia GPU to do a passtrough, I installed the CPU version of PyTorch. I think the exact command I run was

pip3 install torch torchvision torchaudio

While I'm able to run the streamlit version, if I try to start the native version I get an AssertionError:

(venv) C:\Users\vboxuser\xtts2-ui>python app.py
 > tts_models/multilingual/multi-dataset/xtts_v2 is already downloaded.
C:\Users\vboxuser\xtts2-ui\venv\lib\site-packages\transformers\utils\generic.py:311: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
 > Using model: xtts
Traceback (most recent call last):
  File "C:\Users\vboxuser\xtts2-ui\app.py", line 38, in <module>
    tts = TTS(model_name=params["model_name"]).to(device)
  File "C:\Users\vboxuser\xtts2-ui\venv\lib\site-packages\torch\nn\modules\module.py", line 1152, in to
    return self._apply(convert)
  File "C:\Users\vboxuser\xtts2-ui\venv\lib\site-packages\torch\nn\modules\module.py", line 802, in _apply
    module._apply(fn)
  File "C:\Users\vboxuser\xtts2-ui\venv\lib\site-packages\torch\nn\modules\module.py", line 802, in _apply
    module._apply(fn)
  File "C:\Users\vboxuser\xtts2-ui\venv\lib\site-packages\torch\nn\modules\module.py", line 802, in _apply
    module._apply(fn)
  [Previous line repeated 2 more times]
  File "C:\Users\vboxuser\xtts2-ui\venv\lib\site-packages\torch\nn\modules\module.py", line 825, in _apply
    param_applied = fn(param)
  File "C:\Users\vboxuser\xtts2-ui\venv\lib\site-packages\torch\nn\modules\module.py", line 1150, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
  File "C:\Users\vboxuser\xtts2-ui\venv\lib\site-packages\torch\cuda\__init__.py", line 293, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

Which seems correct to me: I indeed installed Pytorch without CUDA support, as per the README this project seems to support running it without CUDA (and indeed the streamlit version appears to work). Why is there an assertion checking for CUDA? How could I solve this? Thank you for your help,

GTP

GTP95 commented 5 months ago

Nevermind, fixed after looking at issue #14 .