@sonblet

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

pyannoteで話者分離したいが、接続エラーになる

解決したいこと

pyannoteとwhisperを使って、文字起こし+話者分離をしようとしています。
しかし、pyannoteが接続エラーになってしまいます。
解決方法を教えて下さい。

発生している問題・エラー

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-5-78f0c6212545> in <cell line: 1>()
----> 1 from pyannote.audio import Pipeline
      2 pipeline = Pipeline.from_pretrained('pyannote/speaker-diarization', use_auth_token=True)

15 frames
/usr/local/lib/python3.10/dist-packages/pyannote/audio/__init__.py in <module>
     27 
     28 
---> 29 from .core.inference import Inference
     30 from .core.io import Audio
     31 from .core.model import Model

/usr/local/lib/python3.10/dist-packages/pyannote/audio/core/inference.py in <module>
     30 from einops import rearrange
     31 from pyannote.core import Segment, SlidingWindow, SlidingWindowFeature
---> 32 from pytorch_lightning.utilities.memory import is_oom_error
     33 
     34 from pyannote.audio.core.io import AudioFile

/usr/local/lib/python3.10/dist-packages/pytorch_lightning/__init__.py in <module>
     28     _logger.propagate = False
     29 
---> 30 from pytorch_lightning.callbacks import Callback  # noqa: E402
     31 from pytorch_lightning.core import LightningDataModule, LightningModule  # noqa: E402
     32 from pytorch_lightning.trainer import Trainer  # noqa: E402

/usr/local/lib/python3.10/dist-packages/pytorch_lightning/callbacks/__init__.py in <module>
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
---> 14 from pytorch_lightning.callbacks.base import Callback
     15 from pytorch_lightning.callbacks.device_stats_monitor import DeviceStatsMonitor
     16 from pytorch_lightning.callbacks.early_stopping import EarlyStopping

/usr/local/lib/python3.10/dist-packages/pytorch_lightning/callbacks/base.py in <module>
     23 
     24 import pytorch_lightning as pl
---> 25 from pytorch_lightning.utilities.types import STEP_OUTPUT
     26 
     27 

/usr/local/lib/python3.10/dist-packages/pytorch_lightning/utilities/__init__.py in <module>
     16 import numpy
     17 
---> 18 from pytorch_lightning.utilities.apply_func import move_data_to_device  # noqa: F401
     19 from pytorch_lightning.utilities.distributed import AllGatherGrad  # noqa: F401
     20 from pytorch_lightning.utilities.enums import (  # noqa: F401

/usr/local/lib/python3.10/dist-packages/pytorch_lightning/utilities/apply_func.py in <module>
     27 
     28 from pytorch_lightning.utilities.exceptions import MisconfigurationException
---> 29 from pytorch_lightning.utilities.imports import _compare_version, _TORCHTEXT_LEGACY
     30 from pytorch_lightning.utilities.warnings import rank_zero_deprecation
     31 

/usr/local/lib/python3.10/dist-packages/pytorch_lightning/utilities/imports.py in <module>
    116 _TORCH_QUANTIZE_AVAILABLE = bool([eg for eg in torch.backends.quantized.supported_engines if eg != "none"])
    117 _TORCHTEXT_AVAILABLE = _package_available("torchtext")
--> 118 _TORCHTEXT_LEGACY: bool = _TORCHTEXT_AVAILABLE and _compare_version("torchtext", operator.lt, "0.11.0")
    119 _TORCHVISION_AVAILABLE = _package_available("torchvision")
    120 _WANDB_AVAILABLE = _package_available("wandb")

/usr/local/lib/python3.10/dist-packages/pytorch_lightning/utilities/imports.py in _compare_version(package, op, version, use_base_version)
     69     """
     70     try:
---> 71         pkg = importlib.import_module(package)
     72     except (ImportError, DistributionNotFound):
     73         return False

/usr/lib/python3.10/importlib/__init__.py in import_module(name, package)
    124                 break
    125             level += 1
--> 126     return _bootstrap._gcd_import(name[level:], package, level)
    127 
    128 

/usr/local/lib/python3.10/dist-packages/torchtext/__init__.py in <module>
      4 
      5 # the following import has to happen first in order to load the torchtext C++ library
----> 6 from torchtext import _extension  # noqa: F401
      7 
      8 _TEXT_BUCKET = "https://download.pytorch.org/models/text/"

/usr/local/lib/python3.10/dist-packages/torchtext/_extension.py in <module>
     62 
     63 
---> 64 _init_extension()

/usr/local/lib/python3.10/dist-packages/torchtext/_extension.py in _init_extension()
     56         raise ImportError("torchtext C++ Extension is not found.")
     57 
---> 58     _load_lib("libtorchtext")
     59     # This import is for initializing the methods registered via PyBind11
     60     # This has to happen after the base library is loaded

/usr/local/lib/python3.10/dist-packages/torchtext/_extension.py in _load_lib(lib)
     48     if not path.exists():
     49         return False
---> 50     torch.ops.load_library(path)
     51     return True
     52 

/usr/local/lib/python3.10/dist-packages/torch/_ops.py in load_library(self, path)
    571             # static (global) initialization code in order to register custom
    572             # operators with the JIT.
--> 573             ctypes.CDLL(path)
    574         self.loaded_libraries.add(path)
    575 

/usr/lib/python3.10/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    372 
    373         if handle is None:
--> 374             self._handle = _dlopen(self._name, mode)
    375         else:
    376             self._handle = handle

OSError: /usr/local/lib/python3.10/dist-packages/torchtext/lib/libtorchtext.so: undefined symbol: _ZN2at4_ops10select_int4callERKNS_6TensorElN3c106SymIntE

該当するソースコード

!pip install pyannote.audio
from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained('pyannote/speaker-diarization', use_auth_token='********')

自分で試したこと

自分なりにいろいろググってみたのですが、何もわかりませんでした…
トークンは取得済み、規約にも同意済みです。

0 likes

1Answer

OSError: /usr/local/lib/python3.10/dist-packages/torchtext/lib/libtorchtext.so: undefined symbol: _ZN2at4_ops10select_int4callERKNS_6TensorElN3c106SymIntE

このエラーだと、インストールが不完全のように見えますが。

下記サイトには、「Hugging faceのトークンが必要」とありましたが、取得済みでしょうか?
インストールの方法などの参考になりませんか?

pyannoteを知らないのでネットでの情報です。外していたらごめんなさい。

1Like

Comments

  1. @sonblet

    Questioner

    回答ありがとうございます!
    はい、トークンは取得済みなんですが、それでも上記のエラーが出てしまいます汗

Your answer might help someone💌