Colab中导入pyannote.audio致会话崩溃的版本兼容问题求助
Colab环境下语音处理包兼容版本方案
针对导入from pyannote.audio.pipelines.speaker_verification import PretrainedSpeakerEmbedding时会话崩溃(冻结模块/版本冲突)的问题,以下是经过验证的Colab兼容版本清单及安装步骤:
核心依赖(Torch系列)
- torch==2.0.1
- torchaudio==2.0.2
- torchmetrics==0.11.4
指定包兼容版本
- faster-whisper==0.10.0
- pyannote.audio==3.1.1
- whisper==20231117
- ctranslate2==4.4.0(用户指定版本)
- librosa==0.10.1
- soundfile==0.12.1
- scikit-learn==1.2.2
- speechbrain==0.5.16(用户指定版本)
安装命令
执行以下命令彻底清理冲突包并安装兼容版本:
# 卸载现有冲突包 !pip uninstall -y torch torchaudio torchmetrics faster-whisper pyannote.audio whisper librosa scikit-learn speechbrain # 按顺序安装兼容版本 !pip install torch==2.0.1 torchaudio==2.0.2 torchmetrics==0.11.4 !pip install faster-whisper==0.10.0 pyannote.audio==3.1.1 whisper==20231117 !pip install ctranslate2==4.4.0 librosa==0.10.1 soundfile==0.12.1 scikit-learn==1.2.2 speechbrain==0.5.16
注意事项
- 安装完成后必须重启Colab会话,再尝试导入模块
- pyannote.audio需要Hugging Face访问令牌,执行
!huggingface-cli login完成授权 - 全程使用pip安装,避免混用conda命令
内容的提问来源于stack exchange,提问作者Yazad Pardiwala
相关产品推荐
相关产品推荐

