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
11.01k stars 1.83k forks source link

ModuleNotFoundError: No module named 'paddle.nn.layer.layers' #3485

Open z070204z opened 1 year ago

z070204z commented 1 year ago

paddlepaddle:2.4.2 paddlespeech:1.4.1

运行:"paddlespeech_server start --help" 出现错误:ModuleNotFoundError: No module named 'paddle.nn.layer.layers'

使用paddlespeech asr命令没有问题

kobe24o commented 1 year ago

我也遇到了,paddle检查安装没有问题,执行服务 paddlespeech_server start --config_file ./application.yaml 报错了

(pp24) $ paddlespeech_server start --config_file ./application.yaml Traceback (most recent call last): File "/opt/bdp/data01/anaconda3/envs/pp24/bin/paddlespeech_server", line 5, in from paddlespeech.server.entry import server_execute File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/server/init.py", line 20, in from .bin.paddlespeech_client import ASRClientExecutor File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/server/bin/init.py", line 16, in from .paddlespeech_server import ServerExecutor File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/server/bin/paddlespeech_server.py", line 26, in from paddlespeech.server.restful.api import setup_router as setup_http_router File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/server/restful/api.py", line 23, in from paddlespeech.server.restful.text_api import router as text_router File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/server/restful/text_api.py", line 21, in from paddlespeech.server.engine.text.python.text_engine import PaddleTextConnectionHandler File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/server/engine/text/python/text_engine.py", line 19, in from paddlespeech.cli.text.infer import TextExecutor File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/cli/text/init.py", line 14, in from .infer import TextExecutor File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/cli/text/infer.py", line 29, in from paddlespeech.text.models.ernie_linear import ErnieLinear File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/text/models/init.py", line 14, in from .ernie_crf import ErnieCrf File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/text/models/ernie_crf/init.py", line 14, in from .model import ErnieCrf File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlespeech/text/models/ernie_crf/model.py", line 16, in from paddlenlp.layers.crf import LinearChainCrf File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlenlp/init.py", line 35, in from . import ( File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlenlp/data/init.py", line 16, in from .data_collator import * File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlenlp/data/data_collator.py", line 26, in from ..transformers import BertTokenizer File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlenlp/transformers/init.py", line 17, in from .model_utils import PretrainedModel, register_base_model File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlenlp/transformers/model_utils.py", line 63, in from .generation_utils import GenerationMixin File "/opt/bdp/data01/anaconda3/envs/pp24/lib/python3.8/site-packages/paddlenlp/transformers/generation_utils.py", line 29, in from paddle.nn.layer.layers import in_declarative_mode ModuleNotFoundError: No module named 'paddle.nn.layer.layers'

(pp24)$ pip list Package Version


aiohttp 3.8.4 aiosignal 1.3.1 anyio 3.6.2 astor 0.8.1 async-timeout 4.0.2 attrs 22.2.0 audioread 3.0.0 Babel 2.12.1 bce-python-sdk 0.8.79 Bottleneck 1.3.7 braceexpand 0.1.7 brotlipy 0.7.0 certifi 2022.12.7 cffi 1.15.1 charset-normalizer 2.1.1 click 8.1.3 colorama 0.4.6 coloredlogs 15.0.1 colorlog 6.7.0 contourpy 1.0.7 cryptography 39.0.0 cycler 0.11.0 Cython 3.0.0 datasets 2.10.1 decorator 5.1.1 dill 0.3.4 Distance 0.1.3 editdistance 0.6.2 einops 0.6.1 fastapi 0.95.0 filelock 3.10.0 Flask 2.2.3 Flask-Babel 2.0.0 flatbuffers 23.5.26 fonttools 4.39.2 frozenlist 1.3.3 fsspec 2023.3.0 ftfy 6.1.1 future 0.18.3 g2p-en 2.1.0 g2pM 0.1.2.5 h11 0.14.0 h5py 3.9.0 huggingface-hub 0.13.2 humanfriendly 10.0 HyperPyYAML 1.2.1 idna 3.4 importlib-metadata 6.1.0 importlib-resources 5.12.0 inflect 7.0.0 itsdangerous 2.1.2 jieba 0.42.1 Jinja2 3.1.2 joblib 1.2.0 jsonlines 3.1.0 kaldiio 2.18.0 kiwisolver 1.4.4 librosa 0.8.1 llvmlite 0.40.1 loguru 0.7.0 lxml 4.9.3 markdown-it-py 2.2.0 MarkupSafe 2.1.2 matplotlib 3.7.1 mdurl 0.1.2 mock 5.1.0 mpmath 1.3.0 multidict 6.0.4 multiprocess 0.70.12.2 nara-wpe 0.0.9 nltk 3.8.1 numba 0.57.1 numpy 1.24.2 onnx 1.14.0 onnxruntime 1.15.1 OpenCC 1.1.6 opencc-python-reimplemented 0.1.7 opt-einsum 3.3.0 packaging 23.0 paddle-bfloat 0.1.7 paddle2onnx 1.0.6 paddleaudio 1.1.0 paddlefsl 1.1.0 paddlenlp 2.6.0 paddlepaddle-gpu 2.4.2.post116 paddleslim 2.4.1 paddlespeech 1.4.1 paddlespeech-feat 0.1.0 pandas 1.5.3 parameterized 0.9.0 pathos 0.2.8 pattern-singleton 1.2.0 Pillow 9.4.0 pip 23.0.1 platformdirs 3.10.0 pooch 1.7.0 portalocker 2.7.0 pox 0.3.3 ppdiffusers 0.16.3 ppft 1.7.6.7 praatio 5.1.1 prettytable 3.8.0 protobuf 3.20.2 pyarrow 11.0.0 pybind11 2.11.1 pycparser 2.21 pycryptodome 3.17 pydantic 1.10.6 Pygments 2.14.0 pygtrie 2.5.0 pyOpenSSL 23.0.0 pyparsing 3.0.9 pypinyin 0.44.0 pypinyin-dict 0.6.0 PySocks 1.7.1 python-dateutil 2.8.2 pytz 2022.7.1 pyworld 0.3.4 PyYAML 6.0 pyzmq 25.1.1 regex 2023.8.8 requests 2.28.2 resampy 0.4.2 responses 0.18.0 rich 13.3.2 ruamel.yaml 0.17.28 ruamel.yaml.clib 0.2.7 sacrebleu 2.3.1 safetensors 0.3.2 scikit-learn 1.2.2 scipy 1.10.1 sentencepiece 0.1.97 seqeval 1.2.2 setuptools 65.6.3 six 1.16.0 sniffio 1.3.0 soundfile 0.12.1 starlette 0.26.1 swig 4.1.1 sympy 1.12 tabulate 0.9.0 TextGrid 1.5 threadpoolctl 3.1.0 timer 0.2.2 ToJyutping 0.2.3 tqdm 4.65.0 typeguard 2.13.3 typer 0.7.0 typing_extensions 4.5.0 urllib3 1.26.15 uvicorn 0.21.1 visualdl 2.4.2 wcwidth 0.2.6 webrtcvad 2.0.10 websockets 11.0.3 Werkzeug 2.2.3 wheel 0.38.4 xxhash 3.2.0 yacs 0.1.8 yarl 1.8.2 zhon 2.0.2 zipp 3.15.0

z070204z commented 1 year ago

我换成了paddlepaddle2.5.1+自己编译最新版paddlespeech解决了

diaojinlong commented 1 year ago

我的paddlepaddle2.5.1,运行paddle.utils.run_check()提示The GPU architecture in your current machine is Pascal, which is not compatible with Paddle installation with arch: 70 75 80 86 , it is recommended to install the corresponding wheel package according to the installation information on the official Paddle website. 然后运行paddlespeech asr --lang zh --input zh.wav 并未使用gpu

gbnj2004 commented 1 year ago

原因是这样的 : 当你使用pip安装paddlepaddle 2.4.2时 会自动安装最新版的paddlenlp 目前paddlenlp版本是2.6.0 该版本与paddlepaddle 2.4.2不兼容会报这个错 你需要手动pip安装paddlenlp 2.5.2版本即可

hjhcos commented 9 months ago

最新版本paddle 2.6.0 加最新版 PaddleSpeech 源码 pip install . 安装不存在任何问题

qinhuangdaoStation commented 2 months ago

原因是这样的 : 当你使用pip安装paddlepaddle 2.4.2时 会自动安装最新版的paddlenlp 目前paddlenlp版本是2.6.0 该版本与paddlepaddle 2.4.2不兼容会报这个错 你需要手动pip安装paddlenlp 2.5.2版本即可

感谢,解决了