pyannote / pyannote-audio

Neural building blocks for speaker diarization: speech activity detection, speaker change detection, overlapped speech detection, speaker embedding
http://pyannote.github.io
MIT License
5.95k stars 756 forks source link

AttributeError: module 'triton' has no attribute 'language' #1757

Closed Alonelymess closed 1 week ago

Alonelymess commented 1 week ago

Tested versions

pyannote.audio 3.3.1

System information

Ubuntu 22.04

Issue description

I want to use Speaker diarization Here is the code I use:

from pyannote.audio.pipelines import SpeakerDiarization
from pyannote.audio import Pipeline

Then it raise an error show that triton doesn't have module language

Traceback (most recent call last):
  File "/mnt/g/Diarization/infer.py", line 3, in <module>
    from pyannote.audio.pipelines import SpeakerDiarization
  File "/home/minh/py310/lib/python3.10/site-packages/pyannote/audio/__init__.py", line 29, in <module>
    from .core.inference import Inference
  File "/home/minh/py310/lib/python3.10/site-packages/pyannote/audio/core/inference.py", line 33, in <module>
    from pytorch_lightning.utilities.memory import is_oom_error
  File "/home/minh/py310/lib/python3.10/site-packages/pytorch_lightning/__init__.py", line 25, in <module>
    from lightning_fabric.utilities.seed import seed_everything  # noqa: E402
  File "/home/minh/py310/lib/python3.10/site-packages/lightning_fabric/__init__.py", line 30, in <module>
    from lightning_fabric.fabric import Fabric  # noqa: E402
  File "/home/minh/py310/lib/python3.10/site-packages/lightning_fabric/fabric.py", line 46, in <module>
    from lightning_fabric.loggers import Logger
  File "/home/minh/py310/lib/python3.10/site-packages/lightning_fabric/loggers/__init__.py", line 15, in <module>
    from lightning_fabric.loggers.tensorboard import TensorBoardLogger  # noqa: F401
  File "/home/minh/py310/lib/python3.10/site-packages/lightning_fabric/loggers/tensorboard.py", line 30, in <module>
    from lightning_fabric.wrappers import _unwrap_objects
  File "/home/minh/py310/lib/python3.10/site-packages/lightning_fabric/wrappers.py", line 38, in <module>
    from torch._dynamo import OptimizedModule
  File "/home/minh/py310/lib/python3.10/site-packages/torch/_dynamo/__init__.py", line 2, in <module>
    from . import convert_frame, eval_frame, resume_execution
  File "/home/minh/py310/lib/python3.10/site-packages/torch/_dynamo/convert_frame.py", line 48, in <module>
    from . import config, exc, trace_rules
  File "/home/minh/py310/lib/python3.10/site-packages/torch/_dynamo/exc.py", line 12, in <module>
    from .utils import counters
  File "/home/minh/py310/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 1066, in <module>
    common_constant_types.add(triton.language.dtype)
AttributeError: module 'triton' has no attribute 'language'

I just create a virtual env in python 3.10.12 and pyannote.audio 3.3.1

Minimal reproduction example (MRE)

Create new env with python 3.10 using virtual env pip install pyannote.audio Run the code above

hbredin commented 1 week ago

Would you mind sharing a link to a Google Colab that one can just click and run to reproduce the issue?

Alonelymess commented 1 week ago

Would you mind sharing a link to a Google Colab that one can just click and run to reproduce the issue?

I'm not sure google colab can create a new environment with python 3.10? I just create a new virtual env use python 3.10.12, then pip install pyannote.audio. The "from pyannote.audio.pipelines import SpeakerDiarization" right from the beginning lead to that error

Alonelymess commented 1 week ago

Anyway I just comment the line:

# if has_triton_package():
#     import triton

#     common_constant_types.add(triton.language.dtype)

from ".../miniconda3/envs/py310/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 1066 (Because this line cause the error above) I check the triton version is 3.0.0 And it works !!? Very strange tho