You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though it wasn't causing any issues in usage, on Windows (10) I was finding my output logs to be full of (handled) exceptions from torch audio like:
DEBUG:torio._extension.utils:Loading FFmpeg6
DEBUG:torio._extension.utils:Failed to load FFmpeg6 extension.
Traceback (most recent call last):
File "C:\Users\XXXXXX\.venv\gijiroku\Lib\site-packages\torio\_extension\utils.py", line 116, in _find_ffmpeg_extension
ext = _find_versionsed_ffmpeg_extension(ffmpeg_ver)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXXXXX\.venv\gijiroku\Lib\site-packages\torio\_extension\utils.py", line 108, in _find_versionsed_ffmpeg_extension
_load_lib(lib)
File "C:\Users\XXXXXX\.venv\gijiroku\Lib\site-packages\torio\_extension\utils.py", line 94, in _load_lib
torch.ops.load_library(path)
File "C:\Users\XXXXXX\.venv\gijiroku\Lib\site-packages\torch\_ops.py", line 1032, in load_library
ctypes.CDLL(path)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1008.0_x64__qbz5n2kfra8p0\Lib\ctypes\__init__.py", line 379, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module 'C:\Users\XXXXXX\.venv\gijiroku\Lib\site-packages\torio\lib\libtorio_ffmpeg6.pyd' (or one of its dependencies). Try using the full path with constructor syntax.
and so on as it carried on trying lower and lower version numbers.
I thought it odd as I have ffmpeg installed and accessible in my PATH.
Long story short, it looks like it's a bug with the current version of torch audio - open issue at pytorch/audio#3789 - whereby the path is not checked for DLLs on Windows if Python version is > 3.8)
I followed the first part of the advice given at pytorch/audio#3789 (comment) - as that can be done in client code (they also dipped into torchaudio code to fix it there but I'd rather not) and so have added this code to my imports:
import sys
if sys.platform == 'win32':
from torchaudio._extension.utils import _init_dll_path
and called it just before initialising anything in the library (e.g. get_engine() or TextToAudioStream()):
if sys.platform == 'win32':
_init_dll_path()
Probably an imperfect solution, but those exceptions no longer occur for me at least and I thought it worth sharing.
The text was updated successfully, but these errors were encountered:
Though it wasn't causing any issues in usage, on Windows (10) I was finding my output logs to be full of (handled) exceptions from torch audio like:
and so on as it carried on trying lower and lower version numbers.
I thought it odd as I have ffmpeg installed and accessible in my PATH.
Long story short, it looks like it's a bug with the current version of torch audio - open issue at pytorch/audio#3789 - whereby the path is not checked for DLLs on Windows if Python version is > 3.8)
I followed the first part of the advice given at pytorch/audio#3789 (comment) - as that can be done in client code (they also dipped into torchaudio code to fix it there but I'd rather not) and so have added this code to my imports:
and called it just before initialising anything in the library (e.g.
get_engine()
orTextToAudioStream()
):Probably an imperfect solution, but those exceptions no longer occur for me at least and I thought it worth sharing.
The text was updated successfully, but these errors were encountered: