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
6.38k stars 784 forks source link

ImportError: 'speechbrain' must be installed to use 'speechbrain/spkrec-ecapa-voxceleb' embeddings. Visit https://speechbrain.github.io for installation instructions. #1661

Closed YugwonWon closed 8 months ago

YugwonWon commented 8 months ago

Tested versions

System information

ubuntu 18 pyannote.audio==3.1.1

Issue description

When I install pyannote.audio from python, it also installs the speechbrain package, but it doesn't create a pretrained folder. Originally, the old version had a speechbrain folder, and inside it was a pretrained folder. I installed the new version of pyannote while setting up a new venv, and this happened. I copied the contents of the old version's pretrained folder and ran it, but the function pretrainer.load_collected(device="cpu") on line 141 of interpaces.py doesn't expect a value of device. What should I do?

Minimal reproduction example (MRE)

https://colab.research.google.com/drive/1edF4nPYc8CuTa7gAgr-_9opWeQe1LhED?usp=sharing

lgq-liao commented 8 months ago

from speaker_verification.py the following import will fail as well,

from speechbrain.pretrained import (
        EncoderClassifier as SpeechBrain_EncoderClassifier,
    )

because spechbrain does NOT have pretrained module

hbredin commented 8 months ago

Currently being look at in PR #1659.

leolulu commented 8 months ago

Did you upgrade your code to 3.1 according to the README?

Install [pyannote.audio](https://github.com/pyannote/pyannote-audio) with pip install pyannote.audio
Accept [pyannote/segmentation-3.0](https://hf.co/pyannote/segmentation-3.0) user conditions
Accept [pyannote/speaker-diarization-3.1](https://hf.co/pyannote/speaker-diarization-3.1) user conditions
Create access token at [hf.co/settings/tokens](https://hf.co/settings/tokens).

from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained(
    "pyannote/speaker-diarization-3.1",
    use_auth_token="HUGGINGFACE_ACCESS_TOKEN_GOES_HERE")
YugwonWon commented 8 months ago

I modified the code to match the readme and it worked, thank you.

leminhnguyen commented 5 months ago

Change from:

from speechbrain.pretrained import (
        EncoderClassifier as SpeechBrain_EncoderClassifier,
    )

to

    from speechbrain.inference.speaker import (
        EncoderClassifier as SpeechBrain_EncoderClassifier,
    )

Will solve the issue!!!

gittb commented 5 months ago

Change from:

from speechbrain.pretrained import (
        EncoderClassifier as SpeechBrain_EncoderClassifier,
    )

to

    from speechbrain.inference.speaker import (
        EncoderClassifier as SpeechBrain_EncoderClassifier,
    )

Will solve the issue!!!

The above change from @leminhnguyen was still needed when running the pyannote/speech-separation-ami-1.0 pipeline.

Looks like the change has been made in source but not in the the current pip package.

hbredin commented 5 months ago

Version 3.3.1 fixes this issue.