question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] UserWarning: Failed to initialize NumPy: module compiled against API version 0xf but this version of numpy is 0xe (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:68.)

See original GitHub issue

Describe the bug

TTS requires “numpy-1.21.6” but this time torch cries with the above error

if I upgrade numpy to 1.22.4, this time torch works but TTS cries:

``pkg_resources.DistributionNotFound: The ‘numpy==1.21.6’ distribution was not found and is required by TTS````

How can I fix this dilemma?

To Reproduce

Typing

tts --list_models

in CMD window

Expected behavior

No response

Logs

No response

Environment

{
    "CUDA": {
        "GPU": [],
        "available": false,
        "version": null
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "1.11.0+cpu",
        "TTS": "0.6.2",
        "numpy": "1.21.6"
    },
    "System": {
        "OS": "Windows",
        "architecture": [
            "64bit",
            "WindowsPE"
        ],
        "processor": "Intel64 Family 6 Model 165 Stepping 2, GenuineIntel",
        "python": "3.10.4",
        "version": "10.0.22000"
    }
}

Additional context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
wasertechcommented, Jul 20, 2022

Wait, no numba on py310 has numpy requirement of: Requirement: numpy<1.23,>=1.18 in /home/waser/Projets/Données/TTS/venv-tts/lib/python3.10/site-packages (from numba) (1.21.6) So 1.21.6 should work perfectly, yet here we are…

0reactions
wasertechcommented, Jul 20, 2022

It may not be a bug but it’s an issue. We should keep track of it.

❯ tts --text "This is a wonderful day, and I think I'm going to celebrate with a cookie" --model_name tts_models/en/vctk/vits --speaker_idx p335
RuntimeError: module compiled against API version 0xf but this version of numpy is 0xe
Traceback (most recent call last):
  File "/home/waser/.local/bin/tts", line 5, in <module>
    from TTS.bin.synthesize import main
  File "/home/waser/.local/lib/python3.10/site-packages/TTS/bin/synthesize.py", line 12, in <module>
    from TTS.utils.synthesizer import Synthesizer
  File "/home/waser/.local/lib/python3.10/site-packages/TTS/utils/synthesizer.py", line 14, in <module>
    from TTS.utils.audio import AudioProcessor
  File "/home/waser/.local/lib/python3.10/site-packages/TTS/utils/audio.py", line 3, in <module>
    import librosa
  File "/home/waser/.local/lib/python3.10/site-packages/librosa/__init__.py", line 211, in <module>
    from . import core
  File "/home/waser/.local/lib/python3.10/site-packages/librosa/core/__init__.py", line 5, in <module>
    from .convert import *  # pylint: disable=wildcard-import
  File "/home/waser/.local/lib/python3.10/site-packages/librosa/core/convert.py", line 7, in <module>
    from . import notation
  File "/home/waser/.local/lib/python3.10/site-packages/librosa/core/notation.py", line 8, in <module>
    from ..util.exceptions import ParameterError
  File "/home/waser/.local/lib/python3.10/site-packages/librosa/util/__init__.py", line 83, in <module>
    from .utils import *  # pylint: disable=wildcard-import
  File "/home/waser/.local/lib/python3.10/site-packages/librosa/util/utils.py", line 6, in <module>
    import scipy.ndimage
  File "/usr/lib/python3.10/site-packages/scipy/ndimage/__init__.py", line 151, in <module>
    from ._filters import *  # noqa: F401 F403
  File "/usr/lib/python3.10/site-packages/scipy/ndimage/_filters.py", line 37, in <module>
    from . import _nd_image
ImportError: numpy.core.multiarray failed to import

Using venv with python 3.10.5.

TTS v0.7.1 needs (according to requirements.txt):

  • numba==0.55.1
  • numpy==1.21.6

Numba needs numpy >=1.11, <=1.18 (according to it’s setup.py)

See the issue? [Numba]numpy==1.18 < [TTS]numpy==1.21.6

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to initialize NumPy: module compiled against API ...
UserWarning : Failed to initialize NumPy: module compiled against API version 0xf but this version of numpy is 0xe (Triggered internally at.
Read more >
RuntimeError: module compiled against API version 0xe but ...
it would appear that numpy is up and downgraded during installation. The logs during the installation should tell if that's happening - i ......
Read more >
failed to initialize numpy: module compiled against api version ...
failed to initialize numpy: module compiled against api version 0x10 but this version of numpy is 0xf (triggered internally at ..\torch\csrc\utils\tensor_numpy.
Read more >
module compiled against API version 0xe but this version of ...
Hello, I switched from a standard, CPU environment in GDC to one with a few GPUs. Now, I'm getting the following error. RuntimeError:...
Read more >
UserWarning: Failed to initialize NumPy: module compiled ...
1.问题importtorch时报错:UserWarning: Failed to initialize NumPy: module compiled against API version 0xf but this version2.原因numpy版本 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found