pyannote-audio
pyannote-audio copied to clipboard
Got error of ModuleNotFoundError: No module named 'lightning_fabric'
Hi all
I get the missing module error when importing pyannote.audio
/lib/python3.8/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libtorch_cuda_cu.so: cannot open shared object file: No such file or directory
warn(f"Failed to load image Python extension: {e}")
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ <stdin>:1 in <module> │
│ │
│ /home/hkomari/miniconda3/envs/ondewo-s2t/lib/python3.8/site-packages/pyannote/audio/__init__.py: │
│ 29 in <module> │
│ │
│ 26 │ pass │
│ 27 │
│ 28 │
│ ❱ 29 from .core.inference import Inference │
│ 30 from .core.io import Audio │
│ 31 from .core.model import Model │
│ 32 from .core.pipeline import Pipeline │
│ │
│ /home/hkomari/miniconda3/envs/ondewo-s2t/lib/python3.8/site-packages/pyannote/audio/core/inferen │
│ ce.py:35 in <module> │
│ │
│ 32 from pytorch_lightning.utilities.memory import is_oom_error │
│ 33 │
│ 34 from pyannote.audio.core.io import AudioFile │
│ ❱ 35 from pyannote.audio.core.model import Model │
│ 36 from pyannote.audio.core.task import Resolution │
│ 37 from pyannote.audio.utils.permutation import mae_cost_func, permutate │
│ 38 from pyannote.audio.utils.powerset import Powerset │
│ │
│ /home/hkomari/miniconda3/envs/ondewo-s2t/lib/python3.8/site-packages/pyannote/audio/core/model.p │
│ y:38 in <module> │
│ │
│ 35 import torch.optim │
│ 36 from huggingface_hub import hf_hub_download │
│ 37 from huggingface_hub.utils import RepositoryNotFoundError │
│ ❱ 38 from lightning_fabric.utilities.cloud_io import _load as pl_load │
│ 39 from pyannote.core import SlidingWindow │
│ 40 from pytorch_lightning.utilities.model_summary import ModelSummary │
│ 41 from torch.utils.data import DataLoader │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'lightning_fabric'
After checking the dependencies, I got that pytorch-lightning module is not updated to the version >2.0.1 and that was the reason of the error.
Same here, plus if you look at the "lightning" package that is part of pyannote.audio requirements.txt, fabric is a submodule (lightning.fabric), not a separate one. I think part of pyannote code still refers to an old dependency graph, and that should be updated.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Same problem. It can be solved by changing
# file: /opt/conda/lib/python3.10/site-packages/pyannote/audio/core/model.py
from lightning_fabric.utilities.cloud_io import _load as pl_load
to
from lightning.fabric.utilities.cloud_io import _load as pl_load