Could not find module (libtorchaudio.pyd) #34

Closed
opened 2023-02-24 21:24:41 +00:00 by ifn · 3 comments

Cloned another instance on a Windows 10 PC w/ 3060 ti. Ran setup_cuda.bat and start.bat and ended up with the following error:

D:\TTS\ai-voice-cloning>start.bat

D:\TTS\ai-voice-cloning>call .\venv\Scripts\activate.bat
Traceback (most recent call last):
  File "D:\TTS\ai-voice-cloning\src\main.py", line 3, in <module>
    from utils import *
  File "D:\TTS\ai-voice-cloning\src\utils.py", line 24, in <module>
    import torchaudio
  File "D:\TTS\ai-voice-cloning\venv\lib\site-packages\torchaudio\__init__.py", line 1, in <module>
    from torchaudio import (  # noqa: F401
  File "D:\TTS\ai-voice-cloning\venv\lib\site-packages\torchaudio\_extension.py", line 135, in <module>
    _init_extension()
  File "D:\TTS\ai-voice-cloning\venv\lib\site-packages\torchaudio\_extension.py", line 105, in _init_extension
    _load_lib("libtorchaudio")
  File "D:\TTS\ai-voice-cloning\venv\lib\site-packages\torchaudio\_extension.py", line 52, in _load_lib
    torch.ops.load_library(path)
  File "D:\TTS\ai-voice-cloning\venv\lib\site-packages\torch\_ops.py", line 573, in load_library
    ctypes.CDLL(path)
  File "C:\Program Files\Python3\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'D:\TTS\ai-voice-cloning\venv\Lib\site-packages\torchaudio\lib\libtorchaudio.pyd' (or one of its dependencies). Try using the full path with constructor syntax.

Not sure what the issue is since libtorchaudio.pyd is located in the path.

Cloned another instance on a Windows 10 PC w/ 3060 ti. Ran ```setup_cuda.bat``` and ```start.bat``` and ended up with the following error: ``` D:\TTS\ai-voice-cloning>start.bat D:\TTS\ai-voice-cloning>call .\venv\Scripts\activate.bat Traceback (most recent call last): File "D:\TTS\ai-voice-cloning\src\main.py", line 3, in <module> from utils import * File "D:\TTS\ai-voice-cloning\src\utils.py", line 24, in <module> import torchaudio File "D:\TTS\ai-voice-cloning\venv\lib\site-packages\torchaudio\__init__.py", line 1, in <module> from torchaudio import ( # noqa: F401 File "D:\TTS\ai-voice-cloning\venv\lib\site-packages\torchaudio\_extension.py", line 135, in <module> _init_extension() File "D:\TTS\ai-voice-cloning\venv\lib\site-packages\torchaudio\_extension.py", line 105, in _init_extension _load_lib("libtorchaudio") File "D:\TTS\ai-voice-cloning\venv\lib\site-packages\torchaudio\_extension.py", line 52, in _load_lib torch.ops.load_library(path) File "D:\TTS\ai-voice-cloning\venv\lib\site-packages\torch\_ops.py", line 573, in load_library ctypes.CDLL(path) File "C:\Program Files\Python3\lib\ctypes\__init__.py", line 374, in __init__ self._handle = _dlopen(self._name, mode) FileNotFoundError: Could not find module 'D:\TTS\ai-voice-cloning\venv\Lib\site-packages\torchaudio\lib\libtorchaudio.pyd' (or one of its dependencies). Try using the full path with constructor syntax. ``` Not sure what the issue is since ```libtorchaudio.pyd``` is located in the path.
Owner

Strange, I'll try and replicate it with a fresh install on Windows when I get a chance.

Strange, I'll try and replicate it with a fresh install on Windows when I get a chance.
Owner

Strange, did a clean install and can't replicate it.

I'll assume you're using Python3.9, as problems from users having a different version hasn't happened in a long while. I'll suggest running in a command prompt:

cd /D D:\TTS\ai-voice-cloning\
.\venv\Scripts\activate.bat
python -m pip uninstall torch torchvision torchaudio 
python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

to uninstall and reinstall Torch. From the handful of users mentioning they have weird PyTorch install quirks or whatever, I'll just go on a limb and say to just try and reinstall it.

If that won't work, then I can just zip up my venv again and put it on catbox if you need it.

Strange, did a clean install and can't replicate it. I'll assume you're using Python3.9, as problems from users having a different version hasn't happened in a long while. I'll suggest running in a command prompt: ``` cd /D D:\TTS\ai-voice-cloning\ .\venv\Scripts\activate.bat python -m pip uninstall torch torchvision torchaudio python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116 ``` to uninstall and reinstall Torch. From the handful of users mentioning they have weird PyTorch install quirks or whatever, I'll just go on a limb and say to just try and reinstall it. If that won't work, then I can just zip up my `venv` again and put it on catbox if you need it.
Author

Your script put me on the right track. I had to reinstall pytorch for cuda 11.7

python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117

Honestly, I only figured that was the case by comparing the libraries to my working version of stable diffusion.

Your script put me on the right track. I had to reinstall pytorch for cuda 11.7 ```python -m pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu117``` Honestly, I only figured that was the case by comparing the libraries to my working version of stable diffusion.
mrq closed this issue 2023-02-26 02:11:34 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrq/ai-voice-cloning#34
No description provided.