2noise / ChatTTS

A generative speech model for daily dialogue.
https://2noise.com
GNU Affero General Public License v3.0
32.1k stars 3.49k forks source link

Error launching `python examples/cmd/run.py "Your text 1"` with fbgemm.dll issue #677

Closed donqyu closed 2 months ago

donqyu commented 2 months ago

I have a clean venv with pip install --upgrade -r .\requirements.txt and there is no issue during pip install.

After the installation, I run "python examples/web/webui.py" and it failed with the following log:

 File "xxxxxxxxxxxxxxxxxxx\ChatTTS\examples\web\webui.py", line 13, in <module>
    from examples.web.funcs import *
  File "xxxxxxxxxxxxxxxxxxx\ChatTTS\examples\web\funcs.py", line 13, in <module>
    from tools.seeder import TorchSeedContext
  File "xxxxxxxxxxxxxxxxxxx\ChatTTS\tools\seeder\__init__.py", line 1, in <module>
    from .ctx import TorchSeedContext
  File "xxxxxxxxxxxxxxxxxxx\ChatTTS\tools\seeder\ctx.py", line 1, in <module>
    import torch
  File "venv\Lib\site-packages\torch\__init__.py", line 148, in <module>
    raise err
OSError: [WinError 126] The specified module could not be found. Error loading "venv\chattts\Lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.

Please help me fix it.

Thanks

fumiama commented 2 months ago

Maybe the torch you're using is corrupted. Try

import torch

and you may get the same error. To fix it, try to re-install torch.

donqyu commented 2 months ago

Hi @fumiama , Thanks for your reply.

It's true that import torch got the same error.

Then I re-install torch with pip install torch --force-reinstall

The re-installation is successful however the issue still exists.

Collecting torch
  Using cached torch-2.4.0-cp310-cp310-win_amd64.whl (197.9 MB)
Collecting networkx
  Using cached networkx-3.3-py3-none-any.whl (1.7 MB)
Collecting filelock
  Using cached filelock-3.15.4-py3-none-any.whl (16 kB)
Collecting jinja2
  Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Collecting sympy
  Using cached sympy-1.13.2-py3-none-any.whl (6.2 MB)
Collecting typing-extensions>=4.8.0
  Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Collecting fsspec
  Using cached fsspec-2024.6.1-py3-none-any.whl (177 kB)
Collecting MarkupSafe>=2.0
  Using cached MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl (17 kB)
Collecting mpmath<1.4,>=1.1.0
  Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Installing collected packages: mpmath, typing-extensions, sympy, networkx, MarkupSafe, fsspec, filelock, jinja2, torch
  Attempting uninstall: mpmath
    Found existing installation: mpmath 1.3.0
    Uninstalling mpmath-1.3.0:
      Successfully uninstalled mpmath-1.3.0
  Attempting uninstall: typing-extensions
    Found existing installation: typing_extensions 4.12.2
    Uninstalling typing_extensions-4.12.2:
      Successfully uninstalled typing_extensions-4.12.2
  Attempting uninstall: sympy
    Found existing installation: sympy 1.13.2
    Uninstalling sympy-1.13.2:
      Successfully uninstalled sympy-1.13.2
  Attempting uninstall: networkx
    Found existing installation: networkx 3.3
    Uninstalling networkx-3.3:
      Successfully uninstalled networkx-3.3
  Attempting uninstall: MarkupSafe
    Found existing installation: MarkupSafe 2.1.5
    Uninstalling MarkupSafe-2.1.5:
      Successfully uninstalled MarkupSafe-2.1.5
  Attempting uninstall: fsspec
    Found existing installation: fsspec 2024.6.1
    Uninstalling fsspec-2024.6.1:
      Successfully uninstalled fsspec-2024.6.1
  Attempting uninstall: filelock
    Found existing installation: filelock 3.15.4
    Uninstalling filelock-3.15.4:
      Successfully uninstalled filelock-3.15.4
  Attempting uninstall: jinja2
    Found existing installation: Jinja2 3.1.4
    Uninstalling Jinja2-3.1.4:
      Successfully uninstalled Jinja2-3.1.4
  Attempting uninstall: torch
    Found existing installation: torch 2.4.0
    Uninstalling torch-2.4.0:
      Successfully uninstalled torch-2.4.0
Successfully installed MarkupSafe-2.1.5 filelock-3.15.4 fsspec-2024.6.1 jinja2-3.1.4 mpmath-1.3.0 networkx-3.3 sympy-1.13.2 torch-2.4.0 typing-extensions-4.12.2

$ python examples/cmd/run.py "Your text 1." "Your text 2."

Traceback (most recent call last):
 xxxxxxxxxxxxxx
OSError: [WinError 126] The specified module could not be found. Error loading "xxxxxxxxxxxfbgemm.dll" or one of its dependencies.

Is there any limitation for python version? I'm using Python 3.10.11

fumiama commented 2 months ago

Is there any limitation for python version? I'm using Python 3.10.11

No and py 3.10 works well in test. Maybe you should search existing issue or create one at the pytorch repo.

donqyu commented 2 months ago

Dear fumiama,

Thanks for your great support. Sorry that I didn't mention that I was in Windows.

I've go through the recommended process in my ubuntu system and works perfectly well.

I think this should be a system dependency issue from pytorch.

Thanks again and closing this issue.