daanzu / kaldi-active-grammar

Python Kaldi speech recognition with grammars that can be set active/inactive dynamically at decode-time
GNU Affero General Public License v3.0
332 stars 49 forks source link

Version lock NumPy to `1.19.3` #44

Closed LexiconCode closed 3 years ago

LexiconCode commented 3 years ago

There is an ongoing issue with NumPy 1.19.4 specific to Windows 10, version 20H2 and Windows Server, version 20H2 with AMD processors.

Downgrading pip install numpy==1.19.3 fixes the issue.

ERROR:engine.kaldi:Exception during import of Kaldi engine module: The current Numpy installation ('C:\\Users\\Main\\Desktop\\Caster3-Test-Kaldi-py3-64bit\\WPy64-3860\\python-3.8.6.amd64\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more information: https://tinyurl.com/y3dm3h86
Traceback (most recent call last):
  File "C:\Users\Main\Desktop\Caster3-Test-Kaldi-py3-64bit\WPy64-3860\python-3.8.6.amd64\lib\site-packages\dragonfly\engines\backend_kaldi\__init__.py", line 51, in is_engine_available
    from .engine import KaldiEngine
  File "C:\Users\Main\Desktop\Caster3-Test-Kaldi-py3-64bit\WPy64-3860\python-3.8.6.amd64\lib\site-packages\dragonfly\engines\backend_kaldi\engine.py", line 30, in <module>
    import kaldi_active_grammar
  File "C:\Users\Main\Desktop\Caster3-Test-Kaldi-py3-64bit\WPy64-3860\python-3.8.6.amd64\lib\site-packages\kaldi_active_grammar\__init__.py", line 22, in <module>
    from .wrapper import KaldiAgfNNet3Decoder, KaldiPlainNNet3Decoder
  File "C:\Users\Main\Desktop\Caster3-Test-Kaldi-py3-64bit\WPy64-3860\python-3.8.6.amd64\lib\site-packages\kaldi_active_grammar\wrapper.py", line 17, in <module>
    import numpy as np
  File "C:\Users\Main\Desktop\Caster3-Test-Kaldi-py3-64bit\WPy64-3860\python-3.8.6.amd64\lib\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Users\Main\Desktop\Caster3-Test-Kaldi-py3-64bit\WPy64-3860\python-3.8.6.amd64\lib\site-packages\numpy\__init__.py", line 302, in _win_os_check
    raise RuntimeError(msg.format(__file__)) from None
RuntimeError: The current Numpy installation ('C:\\Users\\Main\\Desktop\\Caster3-Test-Kaldi-py3-64bit\\WPy64-3860\\python-3.8.6.amd64\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity
daanzu commented 3 years ago

Gah, thanks for notifying me of this! I ran into this problem a while back (even though I run Intel) unrelated to KaldiAG, but didn't realize its implications here. (I also am amazed they haven't fixed it yet.) I will push a temporary fix.

daanzu commented 3 years ago

I uploaded a new wheel just for windows: v1.8.3. Please let me know if it works or not.

LexiconCode commented 3 years ago

I was impressed that it's not fixed given the popularity of Numpy. The kaldi active grammar package installs as expected now.