Application not finding libtorchaudio.pyd during runtime despite it being present in specified folder

Pedro_Fukuda: <p>Hello, I’m trying to usa pyannote.audio fo diarization, which uses pytorch, howerver when I try to run the application it returns the fllowing error:</p>
<blockquote>
<p>Traceback (most recent call last):<br>
File “C:\Users\pedroaf\Documents\utils\Transcricao\diarisation_teste.py”, line 1, in <br>
from pyannote.audio import Pipeline<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyannote\audio_<em>init</em>_.py”, line 29, in <br>
from .core.inference import Inference<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyannote\audio\core\inference.py”, line 34, in <br>
from pytorch_lightning.utilities.memory import is_oom_error<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytorch_lightning_<em>init</em>_.py”, line 27, in <br>
from pytorch_lightning.callbacks import Callback  # noqa: E402<br>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytorch_lightning\callbacks_<em>init</em>_.py”, line 14, in <br>
from pytorch_lightning.callbacks.batch_size_finder import BatchSizeFinder<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytorch_lightning\callbacks\batch_size_finder.py”, line 24, in <br>
from pytorch_lightning.callbacks.callback import Callback<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytorch_lightning\callbacks\callback.py”, line 22, in <br>
from pytorch_lightning.utilities.types import STEP_OUTPUT<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\pytorch_lightning\utilities\types.py”, line 40, in <br>
from torchmetrics import Metric<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchmetrics_<em>init</em>_.py”, line 22, in <br>
from torchmetrics import functional  # noqa: E402<br>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchmetrics\functional_<em>init</em>_.py”, line 14, in <br>
from torchmetrics.functional.audio.<em>deprecated import <em>permutation_invariant_training as permutation_invariant_training<br>
File "C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchmetrics\functional\audio_<em>init</em></em>.py", line 14, in <br>
from torchmetrics.functional.audio.pit import permutation_invariant_training, pit_permutate<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchmetrics\functional\audio\pit.py”, line 22, in <br>
from torchmetrics.utilities import rank_zero_warn<br>
File "C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchmetrics\utilities_<em>init</em></em>.py", line 14, in <br>
from torchmetrics.utilities.checks import check_forward_full_state_property<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchmetrics\utilities\checks.py”, line 25, in <br>
from torchmetrics.metric import Metric<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchmetrics\metric.py”, line 30, in <br>
from torchmetrics.utilities.data import (<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchmetrics\utilities\data.py”, line 22, in <br>
from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_1_12, _TORCH_GREATER_EQUAL_1_13, _XLA_AVAILABLE<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchmetrics\utilities\imports.py”, line 51, in <br>
<em>TORCHAUDIO_GREATER_EQUAL_0_10: Optional[bool] = compare_version(“torchaudio”, operator.ge, “0.10.0”)<br>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\lightning_utilities\core\imports.py”, line 77, in compare_version<br>
pkg = importlib.import_module(package)<br>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
File "C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\importlib_<em>init</em></em>.py", line 126, in import_module<br>
return <em>bootstrap.<em>gcd_import(name[level:], package, level)<br>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
File "C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchaudio_<em>init</em></em>.py", line 1, in <br>
from . import (  # noqa: F401<br>
File "C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchaudio_extension_<em>init</em></em>.py", line 45, in <br>
_load_lib(“libtorchaudio”)<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchaudio_extension\utils.py”, line 64, in <em>load_lib<br>
torch.ops.load_library(path)<br>
File “C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torch_ops.py”, line 852, in load_library<br>
ctypes.CDLL(path)<br>
File "C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\ctypes_<em>init</em></em>.py", line 376, in <strong>init</strong><br>
self._handle = _dlopen(self._name, mode)<br>
^^^^^^^^^^^^^^^^^^^^^^^^^<br>
FileNotFoundError: Could not find module ‘C:\Users\pedroaf\AppData\Local\Programs\Python\Python311\Lib\site-packages\torchaudio\lib\libtorchaudio.pyd’ (or one of its dependencies). Try using<br>
the full path with constructor syntax.</p>
</blockquote>
<p>I checked the specified folder and the libtorchaudio.pyd file is present there, my computer has an intel gpu, while the library uses CUDA, is it a hardware limitation or could it be caused be something else?</p>
<p>I am using python 3.11 currently, is it a support problem?</p>
<p>Thanks!</p>

gablacks: <p>I’m having this same issue and can’t find much about it online.  <a class="mention" href="/u/pedro_fukuda">@Pedro_Fukuda</a>, were you able to find a solution?  Thanks</p>