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

[Bug] Execution error: "ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject" #1775

Closed
Baquara opened this issue Jul 22, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@Baquara
Copy link

Baquara commented Jul 22, 2022

Describe the bug

I made a fresh clone and install from the TTS repo, and used a Python virtual environment to install the dependencies.

Then tried to execute tts.

To Reproduce

  • Clone the repository
  • Create a virtual environment
  • Start the virtual environment
  • Use pip install -e .[all,dev,notebooks]
  • Run tts

Expected behavior

The TTS app to run with no errors.

Logs

(mypython) [privateserver@privateserver TTS]$ tts
Traceback (most recent call last):
  File "/home/privateserver/TTS/mypython/bin/tts", line 33, in <module>
    sys.exit(load_entry_point('TTS', 'console_scripts', 'tts')())
  File "/home/privateserver/TTS/mypython/bin/tts", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/privateserver/TTS/TTS/bin/synthesize.py", line 12, in <module>
    from TTS.utils.synthesizer import Synthesizer
  File "/home/privateserver/TTS/TTS/utils/synthesizer.py", line 14, in <module>
    from TTS.utils.audio import AudioProcessor
  File "/home/privateserver/TTS/TTS/utils/audio.py", line 5, in <module>
    import pyworld as pw
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/pyworld/__init__.py", line 7, in <module>
    from .pyworld import *
  File "pyworld/pyworld.pyx", line 1, in init pyworld.pyworld
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Environment

/home/privateserver/TTS/mypython/lib/python3.10/site-packages/torch/cuda/__init__.py:146: UserWarning: 
NVIDIA GeForce RTX 3060 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
If you want to use the NVIDIA GeForce RTX 3060 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
{
    "CUDA": {
        "GPU": [
            "NVIDIA GeForce RTX 3060"
        ],
        "available": true,
        "version": "10.2"
    },
    "Packages": {
        "PyTorch_debug": false,
        "PyTorch_version": "1.12.0+cu102",
        "TTS": "0.7.1",
        "numpy": "1.21.6"
    },
    "System": {
        "OS": "Linux",
        "architecture": [
            "64bit",
            "ELF"
        ],
        "processor": "",
        "python": "3.10.5",
        "version": "#1 SMP PREEMPT_DYNAMIC Sat, 25 Jun 2022 20:22:01 +0000"
    }
}

Additional context

No response

@Baquara Baquara added the bug Something isn't working label Jul 22, 2022
@Baquara Baquara changed the title [Bug] [Bug] Execution error: "ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject" Jul 22, 2022
@p0p4k
Copy link
Contributor

p0p4k commented Jul 22, 2022

Hello, paste the output of pip list . Thanks.

@Baquara
Copy link
Author

Baquara commented Jul 23, 2022

Hello, paste the output of pip list . Thanks.

Here are the results:

(mypython) [privateserver@privateserver TTS]$ pip list
Package               Version      Editable project location
--------------------- ------------ -------------------------
anyascii              0.3.1
appdirs               1.4.4
astroid               2.7.3
audioread             2.1.9
Babel                 2.10.3
black                 22.6.0
bokeh                 1.4.0
certifi               2022.6.15
cffi                  1.15.1
charset-normalizer    2.1.0
click                 8.1.3
coqpit                0.0.16
coverage              6.4.2
cycler                0.11.0
Cython                0.29.28
dateparser            1.1.1
decorator             5.1.1
docopt                0.6.2
Flask                 2.1.3
fonttools             4.34.4
fsspec                2022.5.0
gruut                 2.2.3
gruut-ipa             0.13.0
gruut-lang-cs         2.0.0
gruut-lang-de         2.0.0
gruut-lang-en         2.0.0
gruut-lang-es         2.0.0
gruut-lang-fr         2.0.2
gruut-lang-it         2.0.0
gruut-lang-nl         2.0.2
gruut-lang-pt         2.0.0
gruut-lang-ru         2.0.0
gruut-lang-sv         2.0.0
idna                  3.3
inflect               5.6.2
isort                 5.10.1
itsdangerous          2.1.2
jieba                 0.42.1
Jinja2                3.1.2
joblib                1.1.0
jsonlines             1.2.0
kiwisolver            1.4.4
lazy-object-proxy     1.7.1
librosa               0.8.0
llvmlite              0.38.1
MarkupSafe            2.1.1
matplotlib            3.5.2
mccabe                0.6.1
mecab-python3         1.0.5
mypy-extensions       0.4.3
networkx              2.8.5
nose2                 0.12.0
num2words             0.5.10
numba                 0.55.1
numpy                 1.21.6
packaging             21.3
pandas                1.4.3
pathspec              0.9.0
Pillow                9.2.0
pip                   22.2
platformdirs          2.5.2
pooch                 1.6.0
protobuf              3.19.4
pycparser             2.21
pylint                2.10.2
pynndescent           0.5.7
pyparsing             3.0.9
pypinyin              0.46.0
pysbd                 0.3.4
python-crfsuite       0.9.8
python-dateutil       2.8.2
pytz                  2022.1
pytz-deprecation-shim 0.1.0.post0
pyworld               0.2.10
PyYAML                6.0
regex                 2022.3.2
requests              2.28.1
resampy               0.3.1
scikit-learn          1.1.1
scipy                 1.8.1
setuptools            62.6.0
six                   1.16.0
SoundFile             0.10.3.post1
tensorboardX          2.5.1
threadpoolctl         3.1.0
toml                  0.10.2
tomli                 2.0.1
torch                 1.12.0
torchaudio            0.12.0
tornado               6.2
tqdm                  4.64.0
trainer               0.0.13
TTS                   0.7.1        /home/privateserver/TTS
typing_extensions     4.3.0
tzdata                2022.1
tzlocal               4.2
umap-learn            0.5.1
unidic-lite           1.0.8
urllib3               1.26.10
Werkzeug              2.1.2
wheel                 0.37.1
wrapt                 1.12.1

@p0p4k
Copy link
Contributor

p0p4k commented Jul 23, 2022

Try to upgrade numba and numpy. First uninstall those 2 packages then install the following versions.

pip install numba==0.55.2
pip install numpy==1.22.4

@Baquara
Copy link
Author

Baquara commented Jul 23, 2022

Try to upgrade numba and numpy. First uninstall those 2 packages then install the following versions.

pip install numba==0.55.2
pip install numpy==1.22.4

I just did it, but I am still getting errors (although a different one):

(mypython) [privateserver@privateserver TTS]$ tts
Traceback (most recent call last):
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/pkg_resources/__init__.py", line 581, in _build_master
    ws.require(__requires__)
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/pkg_resources/__init__.py", line 909, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/pkg_resources/__init__.py", line 800, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (numba 0.55.2 (/home/privateserver/TTS/mypython/lib/python3.10/site-packages), Requirement.parse('numba==0.55.1'), {'TTS'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/privateserver/TTS/mypython/bin/tts", line 33, in <module>
    sys.exit(load_entry_point('TTS', 'console_scripts', 'tts')())
  File "/home/privateserver/TTS/mypython/bin/tts", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/privateserver/TTS/TTS/bin/synthesize.py", line 12, in <module>
    from TTS.utils.synthesizer import Synthesizer
  File "/home/privateserver/TTS/TTS/utils/synthesizer.py", line 14, in <module>
    from TTS.utils.audio import AudioProcessor
  File "/home/privateserver/TTS/TTS/utils/audio.py", line 3, in <module>
    import librosa
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/librosa/__init__.py", line 211, in <module>
    from . import core
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/librosa/core/__init__.py", line 5, in <module>
    from .convert import *  # pylint: disable=wildcard-import
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/librosa/core/convert.py", line 7, in <module>
    from . import notation
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/librosa/core/notation.py", line 8, in <module>
    from ..util.exceptions import ParameterError
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/librosa/util/__init__.py", line 83, in <module>
    from .utils import *  # pylint: disable=wildcard-import
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/librosa/util/utils.py", line 10, in <module>
    import numba
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/numba/__init__.py", line 19, in <module>
    from numba.core import config
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/numba/core/config.py", line 15, in <module>
    import llvmlite.binding as ll
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/llvmlite/binding/__init__.py", line 4, in <module>
    from .dylib import *
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/llvmlite/binding/dylib.py", line 3, in <module>
    from llvmlite.binding import ffi
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/llvmlite/binding/ffi.py", line 175, in <module>
    from pkg_resources import resource_filename
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3260, in <module>
    def _initialize_master_working_set():
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3234, in _call_aside
    f(*args, **kwargs)
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/pkg_resources/__init__.py", line 583, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/pkg_resources/__init__.py", line 596, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/home/privateserver/TTS/mypython/lib/python3.10/site-packages/pkg_resources/__init__.py", line 795, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'numba==0.55.1' distribution was not found and is required by TTS

This is a project-side error that can be reproduced on any fresh install by using venv.

@p0p4k
Copy link
Contributor

p0p4k commented Jul 23, 2022

Yes, this is a straightforward error to solve.
pkg_resources.ContextualVersionConflict: (numba 0.55.2 (/home/privateserver/TTS/mypython/lib/python3.10/site-packages), Requirement.parse('numba==0.55.1'), {'TTS'})
That line states that it is trying to find numba==0.55.1 which we state in the requirements file. So, the solution is to -

  1. uninstall TTS.
  2. git clone coqui-TTS
  3. change the numpy/numba versions (numba==0.55.2, numpy==1.22.4) in requirements.txt file.
  4. install TTS, you will see it installs the correct versions now.

Refer to this thread for similar bug. What's interesting is that other thread was also authored by you. 😆

@Baquara
Copy link
Author

Baquara commented Jul 25, 2022

Yes, this is a straightforward error to solve. pkg_resources.ContextualVersionConflict: (numba 0.55.2 (/home/privateserver/TTS/mypython/lib/python3.10/site-packages), Requirement.parse('numba==0.55.1'), {'TTS'}) That line states that it is trying to find numba==0.55.1 which we state in the requirements file. So, the solution is to -

1. uninstall TTS.

2. git clone coqui-TTS

3. change the numpy/numba versions (numba==0.55.2, numpy==1.22.4) in requirements.txt file.

4. install TTS, you will see it installs the correct versions now.

Refer to this thread for similar bug. What's interesting is that other thread was also authored by you. laughing

Changing the requirements file seems to have fixed the problem.
I highly suggest to update the requirements file from the main branch, as this bug is happening on fresh installs. Once this is done, this issue report can be closed.

erogol pushed a commit that referenced this issue Jul 26, 2022
@erogol erogol closed this as completed Jul 26, 2022
noranraskin pushed a commit to noranraskin/TTS that referenced this issue Aug 3, 2022
erogol added a commit that referenced this issue Aug 22, 2022
* Fix checkpointing GAN models (#1641)

* checkpoint sae step crash fix

* checkpoint save step crash fix

* Update gan.py

updated requested changes

* crash fix

* Fix the --model_name and --vocoder_name arguments need a <model_type> element (#1469)

Co-authored-by: Eren Gölge <erogol@hotmail.com>

* Fix Publish CI (#1597)

* Try out manylinux

* temporary removal of useless pipeline

* remove check and use only manylinux

* Try --plat-name

* Add install requirements

* Add back other actions

* Add PR trigger

* Remove conditions

* Fix sythax

* Roll back some changes

* Add other python versions

* Add test pypi upload

* Add username

* Add back __token__ as username

* Modify name of entry to testpypi

* Set it to release only

* Fix version checking

* Fix tokenizer for punc only (#1717)

* Remove redundant config field

* Fix SSIM loss

* Separate loss tests

* Fix BCELoss adressing  #1192

* Make style

* Add durations as aux input for VITS (#1694)

* Add durations as aux input for VITS

* Make style

* Fix tts_tests

* Fix test_get_aux_input

* Make lint

* feat: updated recipes and lr fix (#1718)

- updated the recipes activating more losses for more stable training
- re-enabling guided attention loss
- fixed a bug about not the correct lr fetched for logging

* Implement VitsAudioConfig (#1556)

* Implement VitsAudioConfig

* Update VITS LJSpeech recipe

* Update VITS VCTK recipe

* Make style

* Add missing decorator

* Add missing param

* Make style

* Update recipes

* Fix test

* Bug fix

* Exclude tests folder

* Make linter

* Make style

* Fix device allocation

* Fix SSIM loss correction

* Fix aux tests (#1753)

* Set n_jobs to 1 for resample script

* Delete resample test

* Set n_jobs 1 in vad test

* delete vad test

* Revert "Delete resample test"

This reverts commit bb7c846.

* Remove tests with resample

* Fix for FloorDiv Function Warning (#1760)

* Fix for Floor Function Warning

Fix for Floor Function Warning

* Adding double quotes to fix formatting

Adding double quotes to fix formatting

* Update glow_tts.py

* Update glow_tts.py

* Fix type in download_vctk.sh (#1739)

typo in comment

* Update decoder.py (#1792)

Minor comment correction.

* Update requirements.txt (#1791)

Support for #1775

* Update README.md (#1776)

Fix typo in different and code sample

* Fix & update WaveRNN vocoder model (#1749)

* Fixes KeyError bug. Adding logging to dashboard.

* Make pep8 compliant

* Make style compliant

* Still fixing style

* Fix rand_segment edge case (input_len == seg_len - 1)

* Update requirements.txt; inflect==5.6 (#1809)

New inflect version (6.0) depends on pydantic which has some issues irrelevant to 🐸 TTS. #1808 
Force inflect==5.6 (pydantic free) install to solve dependency issue.

* Update README.md; download progress bar in CLI. (#1797)

* Update README.md

- minor PR
- added model_info usage guide based on #1623 in README.md .

* "added tqdm bar for model download"

* Update manage.py

* fixed style

* fixed style

* sort imports

* Update wavenet.py (#1796)

* Update wavenet.py

Current version does not use "in_channels" argument. 
In glowTTS, we use normalizing flows and so "input dim" == "ouput dim" (channels and length). So, the existing code just uses hidden_channel sized tensor as input to first layer as well as outputs hidden_channel sized tensor. 
However, since it is a generic implementation, I believe it is better to update it for a more general use.

* "in_channels -> hidden_channels"

* Adjust default to be able to process longer sentences (#1835)

Running `tts --text "$text" --out_path …` with a somewhat longer
sentences in the text will lead to warnings like “Decoder stopped with
max_decoder_steps 500” and the sentences just being cut off in the
resulting WAV file.

This happens quite frequently when feeding longer texts (e.g. a blog
post) to `tts`. It's particular frustrating since the error is not
always obvious in the output. You have to notice that there are missing
parts. This is something other users seem to have run into as well [1].

This patch simply increases the maximum number of steps allowed for the
tacotron decoder to fix this issue, resulting in a smoother default
behavior.

[1] mozilla/TTS#734

* Fix language flags generated by espeak-ng phonemizer (#1801)

* fix language flags generated by espeak-ng phonemizer

* Style

* Updated language flag regex to consider all language codes alike

* fix get_random_embeddings --> get_random_embedding (#1726)

* fix get_random_embeddings --> get_random_embedding

function typo leads to training crash, no such function

* fix typo

get_random_embedding

* Introduce numpy and torch transforms (#1705)

* Refactor audio processing functions

* Add tests for numpy transforms

* Fix imports

* Fix imports2

* Implement bucketed weighted sampling for VITS (#1871)

* Update capacitron_layers.py (#1664)

crashing because of dimension miss match   at line no. 57
[batch, 256] vs [batch , 1, 512]
enc_out = torch.cat([enc_out, speaker_embedding], dim=-1)

* updates to dataset analysis notebooks for compatibility with latest version of TTS (#1853)

* Fix BCE loss issue (#1872)

* Fix BCE loss issue

* Remove import

* Remove deprecated files (#1873)

- samplers.py is moved
- distribute.py is replaces by the 👟Trainer

* Handle when no batch sampler (#1882)

* Fix tune wavegrad (#1844)

* fix imports in tune_wavegrad

* load_config returns Coqpit object instead None

* set action (store true) for flag "--use_cuda"; start to tune if module is running as the main program

* fix var order in the result of batch collating

* make style

* make style with black and isort

* Bump up to v0.8.0

* Add new DE Thorsten models (#1898)

- Tacotron2-DDC
- HifiGAN vocoder

Co-authored-by: manmay nakhashi <manmay.nakhashi@gmail.com>
Co-authored-by: camillem <camillem@users.noreply.github.com>
Co-authored-by: WeberJulian <julian.weber@hotmail.fr>
Co-authored-by: a-froghyar <adamfroghyar@gmail.com>
Co-authored-by: ivan provalov <iprovalo@yahoo.com>
Co-authored-by: Tsai Meng-Ting <sarah13680@gmail.com>
Co-authored-by: p0p4k <rajiv.punmiya@gmail.com>
Co-authored-by: Yuri Pourre <yuripourre@users.noreply.github.com>
Co-authored-by: vanIvan <alfa1211@gmail.com>
Co-authored-by: Lars Kiesow <lkiesow@uos.de>
Co-authored-by: rbaraglia <baraglia.r@live.fr>
Co-authored-by: jchai.me <jreus@users.noreply.github.com>
Co-authored-by: Stanislav Kachnov <42406556+geth-network@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants