YaoFANGUK / video-subtitle-generator

视频音频生成字幕,生成srt文件。无需申请第三方API,本地实现音频转文本。基于Transformer的视频字幕生成框架。A GUI tool for generating subtitle from videos and generating srt files.
Apache License 2.0
799 stars 160 forks source link

处理时报错RuntimeError: Numpy is not available #30

Open cykalet opened 10 months ago

cykalet commented 10 months ago

成功打开文件:D:/0software/video-subtitle-generator/test/test_cn.mp4 选择识别的语言: 自动检测 选择识别模式: 标准 ['D:/0software/video-subtitle-generator/test/test_cn.mp4'] 【处理中】开始生成字幕,此步骤可能花费较长时间,请耐心等待... Exception in thread Thread-1 (task): Traceback (most recent call last): File "C:\Program Files\Python310\lib\threading.py", line 1016, in _bootstrap_inner self.run() File "C:\Program Files\Python310\lib\threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "D:\0software\video-subtitle-generator\gui.py", line 175, in task self.sg.run() File "D:\0software\video-subtitle-generator\backend\main.py", line 227, in run transcript = recognizer(data) File "D:\0software\video-subtitle-generator\backend\main.py", line 37, in call mel = whisper.log_mel_spectrogram(audio_data).to(self.model.device) File "D:\0software\video-subtitle-generator\backend\whisper\audio.py", line 131, in log_mel_spectrogram audio = torch.from_numpy(audio) RuntimeError: Numpy is not available

使用了venv,不知道为什么会和系统上装的python有关系

cykalet commented 10 months ago

(venv) D:\0software\video-subtitle-generator>python backend/main.py 请输入文件完整路径:D:\0software\video-subtitle-generator\test\test_cn.mp4 运行程序 【处理中】开始生成字幕,此步骤可能花费较长时间,请耐心等待... Traceback (most recent call last): File "D:\0software\video-subtitle-generator\backend\main.py", line 275, in sg.run() File "D:\0software\video-subtitle-generator\backend\main.py", line 227, in run transcript = recognizer(data) File "D:\0software\video-subtitle-generator\backend\main.py", line 37, in call mel = whisper.log_mel_spectrogram(audio_data).to(self.model.device) File "D:\0software\video-subtitle-generator\backend\whisper\audio.py", line 131, in log_mel_spectrogram audio = torch.from_numpy(audio) RuntimeError: Numpy is not available

850312766 commented 5 months ago

我一开始也是这样,忘了我重装系统了,我装了CUDA和cuDNN,去官网PyTorch找链接,然后在虚拟环境又安装torch框架,然后再运行就行了

huange888 commented 3 months ago

Exception in thread Thread-2 (task): Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner self.run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "D:\PythonFiles\video-subtitle-generator-main\gui.py", line 175, in task self.sg.run() File "D:\PythonFiles\video-subtitle-generator-main\backend\main.py", line 227, in run transcript = recognizer(data) File "D:\PythonFiles\video-subtitle-generator-main\backend\main.py", line 37, in call mel = whisper.log_mel_spectrogram(audio_data).to(self.model.device) File "D:\PythonFiles\video-subtitle-generator-main\backend\whisper\audio.py", line 131, in log_mel_spectrogram audio = torch.from_numpy(audio) RuntimeError: Numpy is not available

huange888 commented 3 months ago

我也遇到了这个问题

850312766 commented 3 months ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。