Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cykalet opened this issue Nov 5, 2023 · 5 comments
Open

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

cykalet opened this issue Nov 5, 2023 · 5 comments

Comments

@cykalet
Copy link

cykalet commented Nov 5, 2023

成功打开文件: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
Copy link
Author

cykalet commented Nov 5, 2023

(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

@cykalet cykalet changed the title 处理时报错 处理时报错RuntimeError: Numpy is not available Dec 7, 2023
@850312766
Copy link

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

@huange888
Copy link

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
Copy link

我也遇到了这个问题

@850312766
Copy link

850312766 commented Jun 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants