tmoroney / auto-subs

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

I Keep Getting WinError126 #55

Open INeedHelp-bit opened 1 month ago

INeedHelp-bit commented 1 month ago

Screenshot 2024-07-24 215341

I tried to uninstall / reinstall the script and python and i still get the same error message. Please help

owatootie commented 1 month ago

im having the same problem

FrancescaFre-bot commented 1 month ago

ho lo stesso errore al termine dell'installazione delle dipendenze WinError 126

FrancescaFre-bot commented 1 month ago

Ho risolto

http://www.dllme.com/dll/files/libomp140_x86_64?sort=upload&arch=0x8664

scaricate il file libomp140_x86_64.dll e incollatelo nella directory windows/system32

così funziona!

kaianvn commented 1 month ago

Adding the DLL worked for me, but after that, it had a problem with my NumPy version, which I fixed uninstalling the current version with pip uninstall numpy and installing specifically the 1.26.4 version pip install numpy==1.26.4 (as morzzz007 said in issue #49), the NumPy error is gone, but it still doesn't run, it looks like it really can't import stable_whisper. I'm using Python 3.12.4 and PyTorch 2.4.0.

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\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\stable_whisper\__init__.py", line 1, in <module>
    from .stabilization import *
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\stable_whisper\stabilization.py", line 6, in <module>
    from whisper.tokenizer import Tokenizer
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper\__init__.py", line 12, in <module>
    from .decoding import DecodingOptions, DecodingResult, decode, detect_language
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper\decoding.py", line 11, in <module>
    from .tokenizer import Tokenizer, get_tokenizer
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\whisper\tokenizer.py", line 8, in <module>
    from transformers import GPT2TokenizerFast
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\__init__.py", line 26, in <module>
    from . import dependency_versions_check
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\dependency_versions_check.py", line 16, in <module>
    from .utils.versions import require_version, require_version_core
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\utils\__init__.py", line 34, in <module>
    from .generic import (
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\utils\generic.py", line 32, in <module>
    from .import_utils import (
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\utils\import_utils.py", line 37, in <module>
    logger = logging.get_logger(__name__)  # pylint: disable=invalid-name
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\utils\logging.py", line 157, in get_logger
    _configure_library_root_logger()
  File "C:\Users\kaian\AppData\Local\Programs\Python\Python312\Lib\site-packages\transformers\utils\logging.py", line 93, in _configure_library_root_logger
    _default_handler.flush = sys.stderr.flush
                             ^^^^^^^^^^^^^^^^
AttributeError: module 'fu_stderr' has no attribute 'flush'
kaianvn commented 1 month ago

I manage to make it work by using the latest stable-ts version instead of the default when installing, as I thought this was mostly some library problem instead of a problem with the code in this project, this fixed for me and I hope it fixes for you! Use the following command in your PowerShell when installing whisper:

pip install -U git+https://github.com/jianfch/stable-ts.git

xarisathos commented 1 month ago

I manage to make it work by using the latest stable-ts version instead of the default when installing, as I thought this was mostly some library problem instead of a problem with the code in this project, this fixed for me and I hope it fixes for you! Use the following command in your PowerShell when installing whisper:

pip install -U git+https://github.com/jianfch/stable-ts.git

Did you make it work in Resolve 18.6 (version of AutoSubs was developed for) or for the recent 19 Beta? I have tried both (Studio) versions but neither worked, even with the command you suggested. I made the Auto-Subs to work, but after rendering the audio it stops before transcribing it in ALL my attempts in both 18.6 and 19b5:

Using model -> [ medium ] MarkIn: 90000 Rendering Audio for Transcription... Progress: 0 % Progress: 0 % Progress: 100 % Audio Rendering Complete! Transcribing Audio... name 'stable_whisper' is not defined

the last line: "name 'stable_whisper' is not defined" haunts my each attempt without going away The Auto-Subs-light doesn't run at all:

  File "C:\Program Files\Blackmagic Design\DaVinci Resolve\Fusion\Scripts\Utility\auto-subs-light.py", line 7
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax

Any help would be really appreciated guys

Thanks

YourAverageMo commented 4 weeks ago

The fix

i dont know about getting the latest version of stable-ts but what seems to be the problem is stable-ts needs a .dll that comes with MSVC. so i just installed microsoft visual studio desktop dev with c++ the only box you need ticked is MSVC V143 - VS 2022 C++ x64/x86 build tools (latest)

that should install the necessary dll's