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

having numpy complex error #199

Open
M-Usamah opened this issue Dec 15, 2023 · 1 comment
Open

having numpy complex error #199

M-Usamah opened this issue Dec 15, 2023 · 1 comment

Comments

@M-Usamah
Copy link

M-Usamah commented Dec 15, 2023

/envs/testVits/bin/python /media/usamah/2AAD843B4D4DD7CD/projects/vits/test.py
Traceback (most recent call last):
File "/media/usamah/2AAD843B4D4DD7CD/projects/vits/test.py", line 14, in
from vit_model.data_utils import TextAudioLoader, TextAudioCollate, TextAudioSpeakerLoader, TextAudioSpeakerCollate
File "/media/usamah/2AAD843B4D4DD7CD/projects/vits/vit_model/data_utils.py", line 9, in
from vit_model.mel_processing import spectrogram_torch
File "/media/usamah/2AAD843B4D4DD7CD/projects/vits/vit_model/mel_processing.py", line 9, in
import librosa
File "/home/usamah/anaconda3/envs/testVits/lib/python3.10/site-packages/librosa/init.py", line 211, in
from . import core
File "/home/usamah/anaconda3/envs/testVits/lib/python3.10/site-packages/librosa/core/init.py", line 9, in
from .constantq import * # pylint: disable=wildcard-import
File "/home/usamah/anaconda3/envs/testVits/lib/python3.10/site-packages/librosa/core/constantq.py", line 1058, in
dtype=np.complex,
File "/home/usamah/anaconda3/envs/testVits/lib/python3.10/site-packages/numpy/init.py", line 324, in getattr
raise AttributeError(former_attrs[attr])
AttributeError: module 'numpy' has no attribute 'complex'.
np.complex was a deprecated alias for the builtin complex. To avoid this error in existing code, use complex by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.complex128 here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'complex_'?

I am running this on python=3.10 which have numpy version of 1.26.2

@mac819
Copy link

mac819 commented Jun 12, 2024

I also faced same issue. Possibly this is happening due to numpy version conflict. To skip this issue, overwriting the file: /home/usamah/anaconda3/envs/testVits/lib/python3.10/site-packages/librosa/core/constantq.py on line 1058 np.complex >> complex.
This will import the modules without any error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants