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.96k stars 756 forks source link

ImportError: cannot import name 'get_ref_type' from 'omegaconf._utils' when importing Inference #1433

Closed blevlabs closed 1 year ago

blevlabs commented 1 year ago

I am on the latest version of pyannote.audio, but when I try to import Inference I get this error:

Traceback (most recent call last):
  File "/home/blabs/Companion/services/sensory/audiovisual/src/audio/audio_service.py", line 24, in <module>
    from pyannote.audio import Audio, Model, Inference
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pyannote/audio/__init__.py", line 29, in <module>
    from .core.inference import Inference
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pyannote/audio/core/inference.py", line 32, in <module>
    from pytorch_lightning.utilities.memory import is_oom_error
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/__init__.py", line 30, in <module>
    from pytorch_lightning.callbacks import Callback  # noqa: E402
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/callbacks/__init__.py", line 26, in <module>
    from pytorch_lightning.callbacks.pruning import ModelPruning
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/callbacks/pruning.py", line 31, in <module>
    from pytorch_lightning.core.lightning import LightningModule
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/core/__init__.py", line 16, in <module>
    from pytorch_lightning.core.lightning import LightningModule
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/core/lightning.py", line 42, in <module>
    from pytorch_lightning.trainer.connectors.data_connector import _DataHookSelector
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/trainer/__init__.py", line 16, in <module>
    from pytorch_lightning.trainer.trainer import Trainer
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/trainer/trainer.py", line 34, in <module>
    from pytorch_lightning.accelerators import Accelerator, GPUAccelerator, HPUAccelerator, IPUAccelerator, TPUAccelerator
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/accelerators/__init__.py", line 14, in <module>
    from pytorch_lightning.accelerators.cpu import CPUAccelerator  # noqa: F401
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/accelerators/cpu.py", line 19, in <module>
    from pytorch_lightning.utilities import device_parser
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/utilities/device_parser.py", line 18, in <module>
    from pytorch_lightning.plugins.environments import TorchElasticEnvironment
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/plugins/__init__.py", line 20, in <module>
    from pytorch_lightning.plugins.training_type.ddp import DDPPlugin
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/plugins/training_type/__init__.py", line 1, in <module>
    from pytorch_lightning.plugins.training_type.ddp import DDPPlugin  # noqa: F401
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/plugins/training_type/ddp.py", line 14, in <module>
    from pytorch_lightning.strategies import DDPStrategy
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/strategies/__init__.py", line 14, in <module>
    from pytorch_lightning.strategies.bagua import BaguaStrategy  # noqa: F401
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/strategies/bagua.py", line 17, in <module>
    from pytorch_lightning.strategies.ddp import DDPStrategy
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/strategies/ddp.py", line 37, in <module>
    from pytorch_lightning.strategies.launchers.subprocess_script import _SubprocessScriptLauncher
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/strategies/launchers/__init__.py", line 16, in <module>
    from pytorch_lightning.strategies.launchers.subprocess_script import _SubprocessScriptLauncher
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 29, in <module>
    from hydra.core.hydra_config import HydraConfig
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/hydra/__init__.py", line 5, in <module>
    from hydra import utils
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/hydra/utils.py", line 10, in <module>
    from hydra._internal.utils import (
  File "/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/hydra/_internal/utils.py", line 16, in <module>
    from omegaconf._utils import get_ref_type
ImportError: cannot import name 'get_ref_type' from 'omegaconf._utils' (/home/blabs/anaconda3/envs/companioncore/lib/python3.9/site-packages/omegaconf/_utils.py)

Process finished with exit code 1

I have tried updating omegaconf, reinstalling both pyannote and omegaconf, ensuring omegaconf is in sync with the required version with the same results

github-actions[bot] commented 1 year ago

Thank you for your issue.You might want to check the FAQ if you haven't done so already.

Feel free to close this issue if you found an answer in the FAQ.

If your issue is a feature request, please read this first and update your request accordingly, if needed.

If your issue is a bug report, please provide a minimum reproducible example as a link to a self-contained Google Colab notebook containing everthing needed to reproduce the bug:

Providing an MRE will increase your chance of getting an answer from the community (either maintainers or other power users).

We also offer paid scientific consulting services around speaker diarization (and speech processing in general).

This is an automated reply, generated by FAQtory

blevlabs commented 1 year ago

Scratch that - this is an issue with the PyPi version. I installed from source and it works fine

timotheecour commented 7 months ago

@blevlabs why close? Running into the same problem; what is the proper fix or workaround?

after pip install pyannote.audio I have to manually downgrade via pip install omegaconf==2.0.6 (as recommended in https://github.com/voicepaw/so-vits-svc-fork/issues/346 or https://github.com/espnet/espnet/issues/5064#issuecomment-1487564179)

which gives pip warnings, eg pyannote-audio 3.1.1 requires omegaconf<3.0,>=2.1, but you have omegaconf 2.0.6 which is incompatible.