PaddlePaddle / PaddleSpeech

Easy-to-use Speech Toolkit including Self-Supervised Learning model, SOTA/Streaming ASR with punctuation, Streaming TTS with text frontend, Speaker Verification System, End-to-End Speech Translation and Keyword Spotting. Won NAACL2022 Best Demo Award.
https://paddlespeech.readthedocs.io
Apache License 2.0
10.97k stars 1.83k forks source link

numpy1.24.3报错 #3235

Open gxmlfx opened 1 year ago

gxmlfx commented 1 year ago

General Question

刚装好后,运行了: paddlespeech asr --lang zh --input zh.wav log如下: Traceback (most recent call last): File "/home/user1/miniconda3/envs/paddle/bin/paddlespeech", line 8, in sys.exit(_execute()) File "/home/user1/miniconda3/envs/paddle/lib/python3.9/site-packages/paddlespeech/cli/entry.py", line 40, in _execute exec("from {} import {}".format(module, cls)) File "", line 1, in File "/home/user1/miniconda3/envs/paddle/lib/python3.9/site-packages/paddlespeech/cli/asr/init.py", line 14, in from .infer import ASRExecutor File "/home/user1/miniconda3/envs/paddle/lib/python3.9/site-packages/paddlespeech/cli/asr/infer.py", line 24, in import librosa File "/home/user1/miniconda3/envs/paddle/lib/python3.9/site-packages/librosa/init.py", line 211, in from . import core File "/home/user1/miniconda3/envs/paddle/lib/python3.9/site-packages/librosa/core/init.py", line 9, in from .constantq import * # pylint: disable=wildcard-import File "/home/user1/miniconda3/envs/paddle/lib/python3.9/site-packages/librosa/core/constantq.py", line 1059, in dtype=np.complex, File "/home/user1/miniconda3/envs/paddle/lib/python3.9/site-packages/numpy/init.py", line 305, 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

mgsky1 commented 1 year ago

+1,有同样的问题

hhuyzp commented 1 year ago

我也遇到了一样的问题,一个个的改底层,找到报错的地方,把np.float还有np.complex去掉np.就好了

mgsky1 commented 1 year ago

原来在setup.py的Librosa库是0.8.1,太老了,然后我们的numpy比较新,就有这个问题。 直接把Librosa删掉,安装0.10.0就行

hhuyzp commented 1 year ago

万分感谢 ------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/PaddleSpeech" @.>; 发送时间: 2023年5月10日(星期三) 中午11:49 @.>; @.**@.>; 主题: Re: [PaddlePaddle/PaddleSpeech] numpy1.24.3报错 (Issue #3235)

原来在setup.py的Librosa库是0.8.1,太老了,然后我们的numpy比较新,就有这个问题。 直接把Librosa删掉,安装0.10.0就行

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

hhuyzp commented 1 year ago

Installing collected packages: msgpack, soxr, lazy-loader, Librosa   Attempting uninstall: Librosa     Found existing installation: librosa 0.8.1     Uninstalling librosa-0.8.1:       Successfully uninstalled librosa-0.8.1 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. paddleaudio 1.1.0 requires librosa==0.8.1, but you have librosa 0.10.0 which is incompatible. paddlespeech 0.0.0 requires librosa==0.8.1, but you have librosa 0.10.0 which is incompatible. Successfully installed Librosa-0.10.0 lazy-loader-0.2 msgpack-1.0.5 soxr-0.3.5

依然有依赖项报错了

------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/PaddleSpeech" @.>; 发送时间: 2023年5月10日(星期三) 中午11:49 @.>; @.**@.>; 主题: Re: [PaddlePaddle/PaddleSpeech] numpy1.24.3报错 (Issue #3235)

原来在setup.py的Librosa库是0.8.1,太老了,然后我们的numpy比较新,就有这个问题。 直接把Librosa删掉,安装0.10.0就行

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

mgsky1 commented 1 year ago

还有一种方式,librosa不变,numpy降级为1.23.5

The deprecation for the aliases np.object, np.bool, np.float, np.complex, np.str, and np.int is expired (introduces NumPy 1.20). Some of these will now give a FutureWarning in addition to raising an error since they will be mapped to the NumPy scalars in the future.

https://numpy.org/devdocs/release/1.24.0-notes.html

refer:https://github.com/coqui-ai/TTS/issues/2442

hhuyzp commented 1 year ago

这个方法可行,只会警告,但不会报错,谢谢你呀

------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/PaddleSpeech" @.>; 发送时间: 2023年5月10日(星期三) 中午12:57 @.>; @.**@.>; 主题: Re: [PaddlePaddle/PaddleSpeech] numpy1.24.3报错 (Issue #3235)

还有一种方式,librosa不变,numpy降级为1.23.5

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

gxmlfx commented 1 year ago

官方的docker镜像也会提示numpy complex的问题。 grep: warning: GREP_OPTIONS is deprecated; please use an alias or script /usr/local/lib/python3.7/dist-packages/librosa/core/constantq.py:1059: DeprecationWarning: np.complex is a deprecated alias for the builtin complex. To silence this warning, 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. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations 但是这里可以继续,这似乎是一个仍可用的numpy版本

运行paddlespeech_server start会报 raise BadZipFile("File is not a zip file") zipfile.BadZipFile: File is not a zip file log如下: grep: warning: GREP_OPTIONS is deprecated; please use an alias or script /usr/local/lib/python3.7/dist-packages/librosa/core/constantq.py:1059: DeprecationWarning: np.complex is a deprecated alias for the builtin complex. To silence this warning, 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. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations dtype=np.complex, Traceback (most recent call last): File "/usr/local/bin/paddlespeech_server", line 5, in from paddlespeech.server.entry import server_execute File "/usr/local/lib/python3.7/dist-packages/paddlespeech/server/init.py", line 16, in from .base_commands import ClientBaseCommand File "/usr/local/lib/python3.7/dist-packages/paddlespeech/server/base_commands.py", line 18, in from .util import cli_client_register File "/usr/local/lib/python3.7/dist-packages/paddlespeech/server/util.py", line 32, in from . import download File "/usr/local/lib/python3.7/dist-packages/paddlespeech/server/download.py", line 30, in from paddlespeech.cli.log import logger File "/usr/local/lib/python3.7/dist-packages/paddlespeech/cli/init.py", line 23, in from .tts import TTSExecutor File "/usr/local/lib/python3.7/dist-packages/paddlespeech/cli/tts/init.py", line 14, in from .infer import TTSExecutor File "/usr/local/lib/python3.7/dist-packages/paddlespeech/cli/tts/infer.py", line 36, in from paddlespeech.t2s.frontend import English File "/usr/local/lib/python3.7/dist-packages/paddlespeech/t2s/init.py", line 18, in from . import frontend File "/usr/local/lib/python3.7/dist-packages/paddlespeech/t2s/frontend/init.py", line 16, in from .phonectic import File "/usr/local/lib/python3.7/dist-packages/paddlespeech/t2s/frontend/phonectic.py", line 20, in from g2p_en import G2p File "/usr/local/lib/python3.7/dist-packages/g2p_en/init.py", line 1, in from .g2p import G2p File "/usr/local/lib/python3.7/dist-packages/g2p_en/g2p.py", line 22, in nltk.data.find('taggers/averaged_perceptron_tagger.zip') File "/usr/local/lib/python3.7/dist-packages/nltk/data.py", line 542, in find return ZipFilePathPointer(p, zipentry) File "/usr/local/lib/python3.7/dist-packages/nltk/compat.py", line 41, in _decorator return init_func(args, *kwargs) File "/usr/local/lib/python3.7/dist-packages/nltk/data.py", line 394, in init zipfile = OpenOnDemandZipFile(os.path.abspath(zipfile)) File "/usr/local/lib/python3.7/dist-packages/nltk/compat.py", line 41, in _decorator return init_func(args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/nltk/data.py", line 935, in init zipfile.ZipFile.init(self, filename) File "/usr/lib/python3.7/zipfile.py", line 1258, in init self._RealGetContents() File "/usr/lib/python3.7/zipfile.py", line 1325, in _RealGetContents raise BadZipFile("File is not a zip file") zipfile.BadZipFile: File is not a zip file

mgsky1 commented 1 year ago

那个只是warning,并不是报错。 那个zip的错误,可以看看这个issue:https://github.com/PaddlePaddle/PaddleSpeech/issues/1925

gxmlfx commented 1 year ago

感谢,我试一下

mgsky1 commented 1 year ago

我最后把这个问题移到【安装报错留言区】了,感觉这样好一些,本质上不是代码问题,只是环境上的问题

xtdhwl commented 11 months ago

conda install -c conda-forge librosa

https://librosa.org/doc/latest/install.html 升级librosa

androidfans commented 11 months ago

原来在setup.py的Librosa库是0.8.1,太老了,然后我们的numpy比较新,就有这个问题。 直接把Librosa删掉,安装0.10.0就行

请问在官方的这个lab页面里面要怎么做这个操作啊 https://aistudio.baidu.com/bd-gpu-01/user/3279555/6931268/lab/tree/main.ipynb

alittlenico commented 10 months ago

还有一种方式,librosa不变,numpy降级为1.23.5

The deprecation for the aliases np.object, np.bool, np.float, np.complex, np.str, and np.int is expired (introduces NumPy 1.20). Some of these will now give a FutureWarning in addition to raising an error since they will be mapped to the NumPy scalars in the future.

https://numpy.org/devdocs/release/1.24.0-notes.html

refer:coqui-ai/TTS#2442

谢谢 也解决了我的问题

ilovejs commented 8 months ago

pip install -U librosa pip freeze | grep librosa # 1.10.*