whisperX
whisperX copied to clipboard
RuntimeError: Library libcublas.so.12 is not found or cannot be loaded
cuda version11.8
File "/App/install/OPS/pyenv/ai-speech/lib/python3.10/site-packages/transformers/pipelines/base.py", line 1112, in forward model_outputs = self._forward(model_inputs, **forward_params) File "/App/install/OPS/whisperX-main/whisperx/asr.py", line 152, in _forward outputs = self.model.generate_segment_batched(model_inputs['inputs'], self.tokenizer, self.options) File "/App/install/OPS/whisperX-main/whisperx/asr.py", line 47, in generate_segment_batched encoder_output = self.encode(features) File "/App/install/OPS/whisperX-main/whisperx/asr.py", line 86, in encode return self.model.encode(features, to_cpu=to_cpu) RuntimeError: Library libcublas.so.12 is not found or cannot be loaded
The installed version is cuda11.8 File/usr/local/cuda/lib64/libcublas.so.11 exists But why would you look for libcublas.so.12?
I had the same problem. By installing Pytorch version Cuda 12.1 and installing whisperX by Pip, this installed the libcublass and cudnn dependencies automatically. pip3 install torch torchvision torchaudio pip install whisperx
The issue stems from faster-whisper having not specify a version in requirements.txt: ctranslate2>=4.0,<5 Leading to the installation of untested versions of CTranslate2: A few days ago a version 4.2.1 of ctranslate2 came out and installing it creates this problem.
pip installing the package ctranslate2==4.2.0 before installing the whisperx package can solve this problem
Update:
I read @Razatator comment 100 times but it took a day to synch in. I updated pytorch-cuda=11.8
to pytorch-cuda=12.1
and now everything works.
New environment.yaml
name: whisperx
channels:
- pytorch
- nvidia
- defaults
dependencies:
- python=3.10
- pip
- pytorch==2.3.1
- torchaudio==2.3.1
- pytorch-cuda=12.1
- torchvision==0.18.1
- pip:
- ctranslate2==4.1.0
- git+https://github.com/m-bain/whisperx.git
Original Issue:
I can't seem to get past this issue and not sure where to look next. I followed the README.md install guide which lead me here. I've tried the workarounds but still running in to the same issue. I can't install ctranslate2==4.2.0
with pip so I tried 4.1.0
.
environment.yaml
name: whisperx
channels:
- pytorch
- nvidia
- defaults
dependencies:
- python=3.10
- pip
- pytorch==2.3.1
- torchaudio==2.3.1
- pytorch-cuda=11.8
- torchvision==0.18.1
- pip:
- ctranslate2==4.1.0
- git+https://github.com/m-bain/whisperx.git
ctranslate2 install error
Pip subprocess error:
Running command git clone --filter=blob:none --quiet https://github.com/m-bain/whisperx.git /tmp/pip-req-build-tystt7ot
ERROR: Could not find a version that satisfies the requirement ctranslate2==4.2.0 (from versions: 2.17.0, 2.18.0, 2.19.0, 2.19.1, 2.20.0, 2.21.0, 2.21.1, 2.22.0, 2.23.0, 2.24.0, 3.0.0, 3.0.1, 3.0.2, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 3.5.0, 3.5.1, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.9.1, 3.10.0, 3.10.1, 3.10.2, 3.10.3, 3.11.0, 3.12.0, 3.13.0, 3.14.0, 3.15.0, 3.15.1, 3.16.0, 3.16.1, 3.17.0, 3.17.1, 3.18.0, 3.19.0, 3.20.0, 3.21.0, 3.22.0, 3.23.0, 3.24.0, 4.0.0, 4.1.0, 4.2.1, 4.3.1)
ERROR: No matching distribution found for ctranslate2==4.2.0
failed
CondaEnvException: Pip failed
whisperx run error:
Traceback (most recent call last):
File "/home/stacks/projects/whisperX/main.py", line 17, in <module>
result = model.transcribe(audio, batch_size=batch_size)
File "/home/stacks/.conda/envs/whisperx/lib/python3.10/site-packages/whisperx/asr.py", line 194, in transcribe
language = language or self.detect_language(audio)
File "/home/stacks/.conda/envs/whisperx/lib/python3.10/site-packages/whisperx/asr.py", line 252, in detect_language
encoder_output = self.model.encode(segment)
File "/home/stacks/.conda/envs/whisperx/lib/python3.10/site-packages/whisperx/asr.py", line 86, in encode
return self.model.encode(features, to_cpu=to_cpu)
RuntimeError: Library libcublas.so.12 is not found or cannot be loaded