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

ASR模型测试遇到这个问题:assert 'augmentation_config' in config #2350

Closed Tian14267 closed 2 years ago

Tian14267 commented 2 years ago

测试模型:PaddleSpeech/examples/aishell/asr0/里面的模型,测试报错:

File "/ultra/fffan/0_TTS/temp/PaddleSpeech/PaddleSpeech_asr/paddlespeech/s2t/io/collator.py", line 230, in from_config
    assert 'augmentation_config' in config
AssertionError

查看代码发现,代码里有这几行:

assert 'augmentation_config' in config
assert 'keep_transcription_text' in config
assert 'mean_std_filepath' in config
assert 'vocab_filepath' in config
assert 'spectrum_type' in config
assert 'n_fft' in config

这些配置在模型配置中并没有。请问这是啥情况

zh794390558 commented 2 years ago

麻烦check下config对象内容是否符合预期。

Tian14267 commented 2 years ago

已经检查过了,release的模型中config确实缺失这些参数。代码里面同样也缺失。这个地方麻烦检查一下。另外,paddlespeech/s2t/io/collator.py

self.augmentation = AugmentationPipeline(
            preprocess_conf=aug_file.read(), random_seed=random_seed)

也有报错。这里的参数无法转换成json。

Tian14267 commented 2 years ago

@zh794390558

zh794390558 commented 2 years ago

是哪个 release的model?你用的是哪个版本的 paddlespeech?

develop里的配置是正常的, https://github.com/PaddlePaddle/PaddleSpeech/tree/develop/examples/aishell/asr0/conf

Tian14267 commented 2 years ago

是哪个 release的model?你用的是哪个版本的 paddlespeech?

模型:asr0_deepspeech2_offline_aishell_ckpt_1.0.1.model image 代码:https://github.com/PaddlePaddle/PaddleSpeech/blob/develop/examples/aishell/asr0/conf/deepspeech2.yaml (模型中的config也一样的bug)

zh794390558 commented 2 years ago

好的,我们看下。

Tian14267 commented 2 years ago

self.augmentation = AugmentationPipeline( preprocess_conf=aug_file.read(), random_seed=random_seed)

大神你好,请问下这个问题现在有解决吗?我也尝试修改,发现“augmentation_config”这个数据读取之后,在进行json.loads()的时候无法成功,我是把“preprocess_config”这个数据给的“augmentation_config”,请问这样是对的吗

Zth9730 commented 2 years ago

我们以提pr解决了这个问题,暂时还未合入主分支,你可以先看一下。