You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

注意事项

  1. 安装完成后必须重启Colab会话,再尝试导入模块
  2. pyannote.audio需要Hugging Face访问令牌,执行!huggingface-cli login完成授权
  3. 全程使用pip安装,避免混用conda命令

内容的提问来源于stack exchange,提问作者Yazad Pardiwala

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 03:07:08