-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
ImportError: cannot import name 'sequence_mask' from 'paddle.fluid.layers' #3520
Comments
怎么样搞定了吗 |
采用paddlepaddle 2.5.1 加 github源码直接pip install . 方式安装; |
git 源码安装 paddlespeech 需要 python 3.10 版本. 参考安装命令: > pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
> python3.10 --version
Python 3.10.13
> python3.10 -m venv ./py310
> ./py310/bin/python --version
Python 3.10.13
> ./py310/bin/pip install paddlepaddle==2.5.2
> git clone https://github.com/PaddlePaddle/PaddleSpeech.git --single-branch --depth=1
> ./py310/bin/pip install ./PaddleSpeech/
测试安装: ./py310/bin/paddlespeech tts --input "测试百度飞桨" --output 1.wav |
安装版本 +问题处理 问题处理: pip install librosa==0.10.1 2 报错信息提示:ModuleNotFoundError: No module named 'paddle.nn.layer.layers' 运行例子 [2023-12-20 17:56:33,740] [ INFO] - All model checkpoint weights were used when initializing ErnieForTokenClassification. [2023-12-20 17:56:33,740] [ INFO] - All the weights of ErnieForTokenClassification were initialized from the model checkpoint at /home/dongao/.paddlespeech/models/ernie_linear_p7_wudao-punc-zh/1.0/ernie_linear_p7_wudao-punc-zh.tar/ckpt. |
一定要使用gcc5吗,使用的是paddlepaddle=2.5.0我在安装develop版本的时候即使已经有其他版本的gcc还是要求安装gcc5,我添加gcc-11-test-results的apt源后,再次安装出现下面错误 libsndfile1 : 依赖: libflac12 (>= 1.3.0) 但无法安装它 |
不用飞桨了... |
系统:windows
Python 3.11.5
安装的CPU版本
python -m pip install paddlepaddle==2.5.1 -i https://mirror.baidu.com/pypi/simple
然后
pip install paddlespeech -i https://pypi.tuna.tsinghua.edu.cn/simple
此时numpy 版本为numpy-1.24.4
运行 paddlespeech cls --input zh.wav
PS D:\work\mgsdk\doc> paddlespeech cls --input zh.wav
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\mghua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts\paddlespeech.exe_main.py", line 4, in
File "C:\Users\mghua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\paddlespeech\cli_init.py", line 16, in
from .asr import ASRExecutor
File "C:\Users\mghua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\paddlespeech\cli\asr_init_.py", line 14, in
from .infer import ASRExecutor
File "C:\Users\mghua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\paddlespeech\cli\asr\infer.py", line 22, in
import librosa
File "C:\Users\mghua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\librosa_init_.py", line 211, in
from . import core
File "C:\Users\mghua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\librosa\core_init_.py", line 9, in
from .constantq import * # pylint: disable=wildcard-import
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mghua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\librosa\core\constantq.py", line 1059, in
dtype=np.complex,
^^^^^^^^^^
File "C:\Users\mghua\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\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 builtincomplex
. To avoid this error in existing code, usecomplex
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, usenp.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_'?
**将constantq.py中的np.complex, 改为 complex后,就又显示
ImportError: cannot import name 'sequence_mask' from 'paddle.fluid.layers'**
The text was updated successfully, but these errors were encountered: