Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install seems broken #1306

Closed
remic33 opened this issue Mar 30, 2023 · 15 comments
Closed

install seems broken #1306

remic33 opened this issue Mar 30, 2023 · 15 comments

Comments

@remic33
Copy link

remic33 commented Mar 30, 2023

Hi everyone,
I am trying to use pyannote audio on 2 envs :
Using python 3.10
one is macbook m2
the other one is on linux cloud, using beam.cloud
The installation seems broken on the two levels.
First, the conda command do not work on Macs, because of version compatibility.
Second the commande pip install pyannote.audio do not seems to work either.
On the cloud, when install, I can not find in Pipeline in pyannote.audio import.

I've see a chunk of code (https://huggingface.co/pyannote/segmentation) where the pipe is imported with models (Btw the first two lines of code are wrong, see importe model and usage at Model)
Am I the only one experiencing those problems?

Here is the install response on Mac :

rc/_hmmc.cpp:35:34: warning: braces around scalar initializer [-Wbraced-scalar-init] auto log = py::array_t<double>{{n}}; ^~~ src/_hmmc.cpp:63:39: warning: braces around scalar initializer [-Wbraced-scalar-init] auto scaling_ = py::array_t<double>{{ns}}; ^~~~ src/_hmmc.cpp:66:8: error: call to deleted constructor of 'pybind11::gil_scoped_release' auto nogil = py::gil_scoped_release{}; ^ ~~~~~~~~~~~~~~~~~~~~~~~~ /private/var/folders/xk/15kdb5qd7hzgslpkbw6mzvy00000gn/T/pip-install-noyfhjeh/hmmlearn_d290987eb9b947adb965e39ff85b5c02/.eggs/pybind11-2.10.4-py3.10.egg/pybind11/include/pybind11/gil.h:155:5: note: 'gil_scoped_release' has been explicitly marked deleted here gil_scoped_release(const gil_scoped_release &) = delete; ^ src/_hmmc.cpp:120:8: error: call to deleted constructor of 'pybind11::gil_scoped_release' auto nogil = py::gil_scoped_release{}; ^ ~~~~~~~~~~~~~~~~~~~~~~~~ /private/var/folders/xk/15kdb5qd7hzgslpkbw6mzvy00000gn/T/pip-install-noyfhjeh/hmmlearn_d290987eb9b947adb965e39ff85b5c02/.eggs/pybind11-2.10.4-py3.10.egg/pybind11/include/pybind11/gil.h:155:5: note: 'gil_scoped_release' has been explicitly marked deleted here gil_scoped_release(const gil_scoped_release &) = delete; ^ src/_hmmc.cpp:154:8: error: call to deleted constructor of 'pybind11::gil_scoped_release' auto nogil = py::gil_scoped_release{}; ^ ~~~~~~~~~~~~~~~~~~~~~~~~ /private/var/folders/xk/15kdb5qd7hzgslpkbw6mzvy00000gn/T/pip-install-noyfhjeh/hmmlearn_d290987eb9b947adb965e39ff85b5c02/.eggs/pybind11-2.10.4-py3.10.egg/pybind11/include/pybind11/gil.h:155:5: note: 'gil_scoped_release' has been explicitly marked deleted here gil_scoped_release(const gil_scoped_release &) = delete; ^ src/_hmmc.cpp:188:8: error: call to deleted constructor of 'pybind11::gil_scoped_release' auto nogil = py::gil_scoped_release{}; ^ ~~~~~~~~~~~~~~~~~~~~~~~~ /private/var/folders/xk/15kdb5qd7hzgslpkbw6mzvy00000gn/T/pip-install-noyfhjeh/hmmlearn_d290987eb9b947adb965e39ff85b5c02/.eggs/pybind11-2.10.4-py3.10.egg/pybind11/include/pybind11/gil.h:155:5: note: 'gil_scoped_release' has been explicitly marked deleted here gil_scoped_release(const gil_scoped_release &) = delete; ^ src/_hmmc.cpp:222:8: error: call to deleted constructor of 'pybind11::gil_scoped_release' auto nogil = py::gil_scoped_release{}; ^ ~~~~~~~~~~~~~~~~~~~~~~~~ /private/var/folders/xk/15kdb5qd7hzgslpkbw6mzvy00000gn/T/pip-install-noyfhjeh/hmmlearn_d290987eb9b947adb965e39ff85b5c02/.eggs/pybind11-2.10.4-py3.10.egg/pybind11/include/pybind11/gil.h:155:5: note: 'gil_scoped_release' has been explicitly marked deleted here gil_scoped_release(const gil_scoped_release &) = delete; ^ src/_hmmc.cpp:258:8: error: call to deleted constructor of 'pybind11::gil_scoped_release' auto nogil = py::gil_scoped_release{}; ^ ~~~~~~~~~~~~~~~~~~~~~~~~ /private/var/folders/xk/15kdb5qd7hzgslpkbw6mzvy00000gn/T/pip-install-noyfhjeh/hmmlearn_d290987eb9b947adb965e39ff85b5c02/.eggs/pybind11-2.10.4-py3.10.egg/pybind11/include/pybind11/gil.h:155:5: note: 'gil_scoped_release' has been explicitly marked deleted here gil_scoped_release(const gil_scoped_release &) = delete; ^ src/_hmmc.cpp:289:47: warning: braces around scalar initializer [-Wbraced-scalar-init] auto state_sequence_ = py::array_t<ssize_t>{{ns}}; ^~~~ src/_hmmc.cpp:293:8: error: call to deleted constructor of 'pybind11::gil_scoped_release' auto nogil = py::gil_scoped_release{}; ^ ~~~~~~~~~~~~~~~~~~~~~~~~ /private/var/folders/xk/15kdb5qd7hzgslpkbw6mzvy00000gn/T/pip-install-noyfhjeh/hmmlearn_d290987eb9b947adb965e39ff85b5c02/.eggs/pybind11-2.10.4-py3.10.egg/pybind11/include/pybind11/gil.h:155:5: note: 'gil_scoped_release' has been explicitly marked deleted here gil_scoped_release(const gil_scoped_release &) = delete; ^ 3 warnings and 7 errors generated. error: command '/usr/bin/clang' failed with exit code 1

Here is the import problem on cloud :
/usr/local/lib/python3.10/dist-packages/torchaudio/_internal/module_utils.py:99: UserWarning: Failed to import soundfile. 'soundfile' backend is not available. warnings.warn("Failed to import soundfile. 'soundfile' backend is not available.") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.10/dist-packages/pyannote/audio/__init__.py", line 29, in <module> from .core.inference import Inference File "/usr/local/lib/python3.10/dist-packages/pyannote/audio/core/inference.py", line 35, in <module> from pyannote.audio.core.model import Model File "/usr/local/lib/python3.10/dist-packages/pyannote/audio/core/model.py", line 46, in <module> from pyannote.audio.core.task import Problem, Resolution, Specifications, Task File "/usr/local/lib/python3.10/dist-packages/pyannote/audio/core/task.py", line 45, in <module> from torch_audiomentations import Identity File "/usr/local/lib/python3.10/dist-packages/torch_audiomentations/__init__.py", line 1, in <module> from .augmentations.background_noise import AddBackgroundNoise File "/usr/local/lib/python3.10/dist-packages/torch_audiomentations/augmentations/background_noise.py", line 10, in <module> from ..utils.file import find_audio_files_in_paths File "/usr/local/lib/python3.10/dist-packages/torch_audiomentations/utils/file.py", line 5, in <module> import soundfile File "/usr/local/lib/python3.10/dist-packages/soundfile.py", line 142, in <module> raise OSError('sndfile library not found') OSError: sndfile library not found

@github-actions
Copy link

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

@hbredin
Copy link
Member

hbredin commented Mar 30, 2023

To maximise the probability of someone answering your question:

  • if your issue is a bug report, please provide a minimum reproducible example, e.g. a link to a self-contained Google Colab notebook (i.e. containing everthing needed to reproduce the bug: installation of pyannote.audio, downloads of models or test data, etc...)

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

@calippo
Copy link

calippo commented Mar 31, 2023

I'm having the same issue on Python 3.10 (update downgrade to 3.8) macbook m1.

I basically cannot install hmmlearn 2.7 or 2.8 that is required by pyannote.audio (I can install 2.6 though).

[Update] I solved the problem building hmmlearn locally, but it's not optimal.

@Jacubeit
Copy link

Jacubeit commented Mar 31, 2023

Same...
Apple M1, 13.2.1
Python3.8/3.9

from pydub import AudioSegment
from pyannote.audio import Pipeline

in VS Code: Import "pyannote.audio" could not be resolved

executing the file gives the following error:

File "some_file.py", line 12, in <module>
    from pyannote.audio import Pipeline
  File "some_path/venv8/lib/python3.8/site-packages/pyannote/audio/__init__.py", line 29, in <module>
    from .core.inference import Inference
  File "some_path/venv8/lib/python3.8/site-packages/pyannote/audio/core/inference.py", line 34, in <module>
    from pyannote.audio.core.io import AudioFile
  File "some_path/venv8/lib/python3.8/site-packages/pyannote/audio/core/io.py", line 38, in <module>
    import torchaudio
  File "some_path/venv8/lib/python3.8/site-packages/torchaudio/__init__.py", line 1, in <module>
    from torchaudio import (  # noqa: F401
  File "some_path/venv8/lib/python3.8/site-packages/torchaudio/_extension.py", line 135, in <module>
    _init_extension()
  File "some_path/venv8/lib/python3.8/site-packages/torchaudio/_extension.py", line 105, in _init_extension
    _load_lib("libtorchaudio")
  File "some_path/venv8/lib/python3.8/site-packages/torchaudio/_extension.py", line 52, in _load_lib
    torch.ops.load_library(path)
  File "some_path/venv8/lib/python3.8/site-packages/torch/_ops.py", line 643, in load_library
    ctypes.CDLL(path)
  File "/opt/homebrew/Cellar/python@3.8/3.8.16/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ctypes/__init__.py", line 373, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(some_path/venv8/lib/python3.8/site-packages/torchaudio/lib/libtorchaudio.so, 0x0006): Symbol not found: __ZN2at4_ops9_pad_enum4callERKNS_6TensorEN3c108ArrayRefIxEExNS5_8optionalIdEE
  Referenced from: <880489EC-8304-3310-A69F-4721C6545626> some_path/venv8/lib/python3.8/site-packages/torchaudio/lib/libtorchaudio.so
  Expected in:     <ADB29998-4917-3D35-B2A2-77968871B420> some_path/venv8/lib/python3.8/site-packages/torch/lib/libtorch_cpu.dylib

May be unrelated though.

@calippo
Copy link

calippo commented Apr 1, 2023

I have the very same error after trying to overcome the installation issue.

@mayeaux
Copy link

mayeaux commented Apr 3, 2023

This should work for the hmmlearn issue:
conda install -c conda-forge hmmlearn

also run this
conda install -c conda-forge libsndfile

Should fix the soundfile backend error

@Jacubeit
Copy link

Jacubeit commented Apr 4, 2023

what worked for me:
requirements.txt:

torch==1.13.1
torchvision==0.14.1
torchaudio==0.13.1   
git+https://github.com/hmmlearn/hmmlearn
git+https://github.com/pyannote/pyannote-audio.git@develop

@remic33
Copy link
Author

remic33 commented Apr 4, 2023

what worked for me: requirements.txt:

torch==1.13.1
torchvision==0.14.1
torchaudio==0.13.1   
git+https://github.com/hmmlearn/hmmlearn
git+https://github.com/pyannote/pyannote-audio.git@develop

Working on mac with those install thanks.
For the beam.cloud install, linux packages were missing, just have to install them using
apt-get update && apt-get install -y libsndfile1 && apt-get install ffmpeg -y
Thanks a lot.

@Majdoddin
Copy link

@Jacubeit Worked for me on Colab, thanks 👍

@PierreVannier
Copy link

I've got an M1 pro on Ventura 13.3.1 (22E261) and I've got the same error as @Jacubeit .
Traceback (most recent call last):
File "/Users/pierrevannier/whisper/whisper.cpp/speechbrain/pyannote_test.py", line 1, in <module> from pyannote.audio import Pipeline File "/Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/pyannote/audio/__init__.py", line 29, in <module> from .core.inference import Inference File "/Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/pyannote/audio/core/inference.py", line 34, in <module> from pyannote.audio.core.io import AudioFile File "/Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/pyannote/audio/core/io.py", line 38, in <module> import torchaudio File "/Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/torchaudio/__init__.py", line 1, in <module> from torchaudio import ( # noqa: F401 File "/Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/torchaudio/_extension.py", line 135, in <module> _init_extension() File "/Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/torchaudio/_extension.py", line 105, in _init_extension _load_lib("libtorchaudio") File "/Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/torchaudio/_extension.py", line 52, in _load_lib torch.ops.load_library(path) File "/Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/torch/_ops.py", line 643, in load_library ctypes.CDLL(path) File "/Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/ctypes/__init__.py", line 374, in __init__ self._handle = _dlopen(self._name, mode) OSError: dlopen(/Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/torchaudio/lib/libtorchaudio.so, 0x0006): Symbol not found: __ZN2at4_ops9_pad_enum4callERKNS_6TensorEN3c108ArrayRefIxEExNS5_8optionalIdEE Referenced from: <3CEB7D0B-51E0-3459-B194-88110B2E8315> /Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/torchaudio/lib/libtorchaudio.so Expected in: <AE6DCE26-A528-35ED-BB3D-88890D27E6B9> /Users/pierrevannier/miniforge3/envs/pyannote/lib/python3.9/site-packages/torch/lib/libtorch_cpu.dylib

@mayeaux
Copy link

mayeaux commented Apr 16, 2023

what worked for me: requirements.txt:

torch==1.13.1
torchvision==0.14.1
torchaudio==0.13.1   
git+https://github.com/hmmlearn/hmmlearn
git+https://github.com/pyannote/pyannote-audio.git@develop

Worked for me as well to get PyTorch working for WhisperX

@MatNab007
Copy link

Hi, can anyone help me with this error?

I try to run the code
segmented, n_clusters, hyp_df, result_hypo = diarization('/content/drive/MyDrive/Speaker_Diarization/output_mono_last.wav')
print(n_clusters)
print(hyp_df)
result_hypo

but i got the error

The repository pyannote_pyannote-audio does not belong to the list of trusted repositories and as such cannot be downloaded. Do you trust this repository and wish to add it to the trusted list of repositories (y/N)?y
Downloading: "https://github.com/pyannote/pyannote-audio/zipball/main" to /root/.cache/torch/hub/main.zip

FileNotFoundError Traceback (most recent call last)
in <cell line: 2>()
1 #Give the path of audio file for Speaker Diarization (It should be Mono type.)
----> 2 segmented, n_clusters, hyp_df, result_hypo = diarization('/content/drive/MyDrive/Speaker_Diarization/output_mono_last.wav')
3 print(n_clusters)
4 print(hyp_df)
5 result_hypo

7 frames
/usr/lib/python3.10/importlib/_bootstrap_external.py in get_data(self, path)

FileNotFoundError: [Errno 2] No such file or directory: '/root/.cache/torch/hub/pyannote_pyannote-audio_main/hubconf.py'

@MatNab007
Copy link

I already download what they told to do, but there is no file name hubconf.py

I cannot understand what to do

@phdosilva
Copy link

what worked for me: requirements.txt:

torch==1.13.1
torchvision==0.14.1
torchaudio==0.13.1   
git+https://github.com/hmmlearn/hmmlearn
git+https://github.com/pyannote/pyannote-audio.git@develop

That was not working in Google Colab and I resolved this by testing:

!pip install torch torchvision torchaudio git+https://github.com/hmmlearn/hmmlearn -qq https://github.com/pyannote/pyannote-audio/archive/refs/heads/develop.zip

Thanks anyway!

@Simon-chai
Copy link

This should work for the hmmlearn issue: conda install -c conda-forge hmmlearn

also run this conda install -c conda-forge libsndfile

Should fix the soundfile backend error

worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants