tmoroney / auto-subs

Generate subtitles using OpenAI Whisper in Davinci Resolve editing software.
MIT License
292 stars 16 forks source link

"Numpy is not available" Error #49

Open alm0r opened 2 weeks ago

alm0r commented 2 weeks ago

Windows 10 Pro Resolve 18.6

I get this error in the Davinci Console after trying to generate the subs. The auto-subs menu is also stuck in the "Transcribing Audio...".

I've tried both, the auto and manual install route. Should i try to unnistall the NumPy 2.0 version and install the 1.0?

Here is the Resolve Console Log:

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "C:\ProgramData\Blackmagic Design\DaVinci Resolve\Fusion\Scripts\Utility\auto-subs.py", line 26, in <module>
    import stable_whisper
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\stable_whisper\__init__.py", line 1, in <module>
    from .whisper_word_level import *
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\stable_whisper\whisper_word_level\__init__.py", line 2, in <module>
    from .cli import cli
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\stable_whisper\whisper_word_level\cli.py", line 11, in <module>
    from ..result import WhisperResult
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\stable_whisper\result.py", line 11, in <module>
    from .stabilization import suppress_silence, get_vad_silence_func, VAD_SAMPLE_RATES
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\stable_whisper\stabilization\__init__.py", line 7, in <module>
    from .nonvad import NONVAD_SAMPLE_RATES, audio2loudness, wav2mask, visualize_mask
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\stable_whisper\stabilization\nonvad.py", line 8, in <module>
    from ..audio.utils import audio_to_tensor_resample
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\stable_whisper\audio\__init__.py", line 7, in <module>
    from .utils import (
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\stable_whisper\audio\utils.py", line 7, in <module>
    import torchaudio
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\torchaudio\__init__.py", line 13, in <module>
    from . import (  # noqa: F401
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\torchaudio\compliance\__init__.py", line 1, in <module>
    from . import kaldi
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\torchaudio\compliance\kaldi.py", line 22, in <module>
    EPSILON = torch.tensor(torch.finfo(torch.float).eps)
C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\site-packages\torchaudio\compliance\kaldi.py:22: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.)
  EPSILON = torch.tensor(torch.finfo(torch.float).eps)
Using model -> [ small.en ]
MarkIn: 216000
Rendering Audio for Transcription...
Progress:  0 %
Progress:  100 %
Audio Rendering Complete!
Transcribing Audio...
Numpy is not available
sudhanshu-ranjan1 commented 2 weeks ago
  1. Uninstall NumPy 2.0
  2. Install a Compatible Version of NumPy [pip install numpy==1.23.5]
  3. Verify the Installation [python -c "import numpy; print(numpy.version)"]
  4. Test Your Davinci Resolve Setup [pip install --force-reinstall stable_whisper torchaudio]
ImanAmeli commented 2 weeks ago
  1. Uninstall NumPy 2.0
  2. Install a Compatible Version of NumPy [pip install numpy==1.23.5]
  3. Verify the Installation [python -c "import numpy; print(numpy.version)"]
  4. Test Your Davinci Resolve Setup [pip install --force-reinstall stable_whisper torchaudio]

i have sam issue but in installing procses u get this:

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

morzzz007 commented 2 weeks ago

Here's how I solved it:

  1. pip uninstall numpy
  2. pip install numpy==1.26.4 (1.26.4 is the latest 1.xx version of numpy, I don't know where the 1.23.5 version mentioned earlier came from)
  3. python -c "import numpy; print(numpy.__version__)"
  4. Don't do this step, no need to install or use the --force-reinstall option. By the way the correct package is openai-whisper or stable-ts, not stable_whisper.
alm0r commented 1 week ago

Here's how I solved it:

1. `pip uninstall numpy`

2. `pip install numpy==1.26.4` (**1.26.4** is the latest 1.xx version of numpy, I don't know where the 1.23.5 version mentioned earlier came from)

3. `python -c "import numpy; print(numpy.__version__)"`

4. Don't do this step, no need to install or use the --force-reinstall option. By the way the correct package is `openai-whisper` or `stable-ts`, not `stable_whisper`.

Thanks a lot, I've managed to make them work.