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

Suggestions for using different PaddleSpeech versions #3528

Open
zxcd opened this issue Sep 19, 2023 · 5 comments
Open

Suggestions for using different PaddleSpeech versions #3528

zxcd opened this issue Sep 19, 2023 · 5 comments

Comments

@zxcd
Copy link
Collaborator

zxcd commented Sep 19, 2023

For now that users currently have many version management issues when using PaddleSpeech, given some suggestions for using different versions are provided here.

PaddleSpeech == develop --> PaddlePaddle == 2.5.0/2.5.1
PaddleSpeech <= 1.4.1 --> PaddlePaddle <= 2.4.2

@BoredWait
Copy link

File "E:\ai\speaker\funasr\dev\Lib\site-packages\paddlespeech\t2s\modules\losses.py", line 20, in
from paddle.fluid.layers import sequence_mask
ImportError: cannot import name 'sequence_mask' from 'paddle.fluid.layers'
报错说是版本问题,搞了好久都没跑起来过,
#3520

@sunqinbo
Copy link

安装版本 +问题处理
(speech_env) dongao@deepin207:/data/works/html/data/source$ pip list|grep paddle
paddle-bfloat 0.1.7
paddle2onnx 1.1.0
paddleaudio 1.1.0
paddlefsl 1.1.0
paddlenlp 2.5.2
paddlepaddle 2.5.2
paddlesde 0.2.5
paddleslim 2.4.1
paddlespeech 1.4.1
paddlespeech-ctcdecoders 0.2.0
paddlespeech-feat 0.1.0

问题处理:
1 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;
由于 paddlespeech 依赖中要求 librosa 版本0.8.1,而且 librosa库使用个了NumPy1.20之前的API导致的

pip install librosa==0.10.1

2 报错信息提示:ModuleNotFoundError: No module named 'paddle.nn.layer.layers'
报错信息:IndexError: list index out of range
由于 paddlepaddle 2.6.1版本 ,降级 paddlenlp 版本到 2.5.2问题得到解决
pip install paddlenlp==2.5.2

运行例子
paddlespeech text --task punc -v --input "你知道吗大部分时候你都在假装学习你在年初提出了一整面墙的todo list到了九月还没打上几个钩你的书架上陈列着全网最畅销的专业书籍"
[2023-12-20 17:56:18,543] [ INFO] - loading configuration file /home/dongao/.paddlespeech/models/ernie_linear_p7_wudao-punc-zh/1.0/ernie_linear_p7_wudao-punc-zh.tar/ckpt/config.json
[2023-12-20 17:56:18,545] [ INFO] - Model config ErnieConfig {
"architectures": [
"ErnieForTokenClassification"
],
"attention_probs_dropout_prob": 0.1,
"enable_recompute": false,
"fuse": false,
"hidden_act": "relu",
"hidden_dropout_prob": 0.1,
"hidden_size": 768,
"id2label": {
"0": "LABEL_0",
"1": "LABEL_1",
"2": "LABEL_2",
"3": "LABEL_3",
"4": "LABEL_4",
"5": "LABEL_5",
"6": "LABEL_6",
"7": "LABEL_7"
},
"initializer_range": 0.02,
"intermediate_size": 3072,
"label2id": {
"LABEL_0": 0,
"LABEL_1": 1,
"LABEL_2": 2,
"LABEL_3": 3,
"LABEL_4": 4,
"LABEL_5": 5,
"LABEL_6": 6,
"LABEL_7": 7
},
"layer_norm_eps": 1e-12,
"max_position_embeddings": 513,
"model_type": "ernie",
"num_attention_heads": 12,
"num_hidden_layers": 12,
"pad_token_id": 0,
"paddlenlp_version": null,
"pool_act": "tanh",
"task_id": 0,
"task_type_vocab_size": 3,
"type_vocab_size": 2,
"use_task_id": false,
"vocab_size": 18000
}

[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.
If your task is similar to the task the model of the checkpoint was trained on, you can already use ErnieForTokenClassification for predictions without further training.
[2023-12-20 17:56:33,761] [ INFO] - Already cached /home/dongao/.paddlenlp/models/ernie-1.0/vocab.txt
[2023-12-20 17:56:33,776] [ INFO] - tokenizer config file saved in /home/dongao/.paddlenlp/models/ernie-1.0/tokenizer_config.json
[2023-12-20 17:56:33,777] [ INFO] - Special tokens file saved in /home/dongao/.paddlenlp/models/ernie-1.0/special_tokens_map.json
你知道吗?大部分时候,你都在假装学习。你在年初提出了一整面墙的todolist,到了九月,还没打上几个钩。你的书架上,陈列着全网最畅销的专业书籍。

@zxcd
Copy link
Collaborator Author

zxcd commented Jan 2, 2024

For now that users currently have many version management issues when using PaddleSpeech, given some suggestions for using different versions are provided here.

PaddleSpeech == develop --> PaddlePaddle == 2.5.0/2.5.1 PaddleSpeech <= 1.4.1 --> PaddlePaddle <= 2.4.2

如果一定需要固定版本,建议
PaddleSpeech == develop, PaddlePaddle == 2.5.1 或
PaddleSpeech == 1.4.1 ,PaddlePaddle == 2.4.2

@hjhcos
Copy link

hjhcos commented Jan 7, 2024

我刚刚解决了 然后我忘记记录怎么解决的 现在我还把venv给删除啦 现在一直报错 嘎嘎 谁懂呀 这种感觉😭😭

@wukaikailive
Copy link

matplotlib==3.7.3
numpy==1.23.4
paddlepaddle==2.4.2
paddlespeech==1.4.1
protobuf==3.19.6
paddlenlp==2.5.2
scipy==1.11.4

实测可以

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

5 participants