Open pweglik opened 5 months ago
I've dived down into the implementation and foudn out the problematic line was rearrange
function in forward
method of PyanNet
. It crashed without leaving any trace. When I swapped :
rearrange(outputs, "batch feature frame -> batch frame feature")
to
torch.permute(outputs, (0, 2, 1))
model loaded correctly. Not sure what caused it, but might be something worth looking at. In einops repo I found similar issue: https://github.com/pytorch/pytorch/issues/94598
Would you mind sharing a link to a Google Colab that one can just click and run to reproduce the issue?
Sorry, I don't have time now and I'm not sure if you're allowed to install your own versions of everything on google collab. But for anyone looking working setup for me is:
python 3.10.13
torch==2.0.0+cu117
pyannote.pipeline==3.0.1
The bug was caused by python 3.11 and it occurred in einops
library, so the bug is on their side. This may be an incentive to use torch.permute
instead of einops.rearrange
(it would remove unnecessary dependency)
Adding cannot_reproduce
label because, well, I cannot reproduce it.
i'm getting the same error while trying to load the model
I am getting the same issue.
I also have the same issue
@hbredin here is how I ran into it on Ubuntu 24.04; I hope it helps with reproducing the issue
sudo apt-get update && sudo apt-get upgrade -y
and sudo apt install python-is-python3 python3-pip python3.12-venv git
python3 -m venv myPythonEnv
and activate it source myPythonEnv/bin/activate
pip install ipywidgets
pip install pyannote.audio
pip install ipython
code .
, create a notebook and pick myPythonEnv kernel
Add the following to the notebook and run them:from huggingface_hub import HfApi
available_pipelines = [p.modelId for p in HfApi().list_models(filter="pyannote-audio-pipeline")]
list(filter(lambda p: p.startswith("pyannote/"), available_pipelines))
from huggingface_hub import notebook_login
notebook_login()
from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained(
"pyannote/speaker-diarization-3.1", use_auth_token=True)
Workaround solution: Use Python 3.10
Adding to my prior comment, the issue is compatibility with the newer versions of Python. I was able to get around this by switching to Python 3.10. After the above steps freeze the dependencies with pip freeze > requirements.txt
and then
Install Python 3.10 in WSL/Ubuntu
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install python3.10 python3.10-venv
Create a new venv with python 3.10, install the dependencies and reopen VS code
python3.10 -m venv p310venv
source p310venv/bin/activate
pip install -r requirements.txt
code .
Then pick the p310venv as the kernel and rerun the blocks in the notebook.
Tested versions
pyannote.audio==3.1.1
System information
Ubuntu 20.04
Issue description
My code:
results in:
Minimal reproduction example (MRE)
-