运行guillaumekln/faster-whisper-large-v2模型进行语音识别的时候报错了
RuntimeError: Library cublas64_12.dll is not found or cannot be loaded
代码:
from faster_whisper import WhisperModelmodel = WhisperModel("H:\\model\\guillaumekln\\faster-whisper-large-v2")segments, info = model.transcribe("E:\\测试材料\\录音\\英语录音.mp3")
for segment in segments:print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
报错日志:
Traceback (most recent call last):File "E:\software\web\pycharm\PyCharm Community Edition 2022.1\plugins\python-ce\helpers\pydev\pydevd.py", line 1491, in _execpydev_imports.execfile(file, globals, locals) # execute the scriptFile "E:\software\web\pycharm\PyCharm Community Edition 2022.1\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfileexec(compile(contents+"\n", file, 'exec'), glob, loc)File "E:/project/english_speak_service/Faster-whisper/WhisperTesk.py", line 5, in <module>segments, info = model.transcribe("E:\\测试材料\\录音\\英语录音.mp3")File "E:\software\web\anaconda3-2024.01.21\envs\common_transformers\lib\site-packages\faster_whisper\transcribe.py", line 344, in transcribeencoder_output = self.encode(segment)File "E:\software\web\anaconda3-2024.01.21\envs\common_transformers\lib\site-packages\faster_whisper\transcribe.py", line 762, in encodereturn self.model.encode(features, to_cpu=to_cpu)
RuntimeError: Library cublas64_12.dll is not found or cannot be loaded
直接原因:cublas64_12.dll动态链接库文件找不到。
间接原因:我这里安装的是cuda的版本是11,他这里运行的需要是cuda12.
参考帖子上的提示:
Windows got errpr: RuntimeError: Library cublas64_11.dll is not found or cannot be loaded · Issue #535 · SYSTRAN/faster-whisper · GitHub
解决:
1,找到cuda安装路径,我这里是 E:\software\web\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin
2,找到cublas64_11.dll,复制出来,改成cublas64_12.dll
代码运行成功: