PaddleSpeech
PaddleSpeech copied to clipboard
语音转文字失败
General Question
输入命令:paddlespeech tts --input "南京现在很冷,下次再去夫子庙吧。" --output ./test_2.wav
然后语音转文字,输入命令:paddlespeech asr --lang zh --input test_2.wav
terminal中输出结果如下:
~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/pkg_resources/init.py:121: DeprecationWarning: pkg_resources is deprecated as an API
warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/pkg_resources/init.py:2870: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
~/anaconda3/envs/paddle_env/lib/python3.9/site-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,
W0618 16:31:50.041340 34357 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 8.9, Driver API Version: 12.2, Runtime API Version: 11.7
W0618 16:31:50.041710 34357 gpu_resources.cc:91] device: 0, cuDNN Version: 8.9.
Input(Y/N):Y
[2023-06-18 16:31:52,881] [ ERROR] - (InvalidArgument) Broadcast dimension mismatch. Operands could not be broadcast together with the shape of X = [1, 1, 0, 333] and the shape of Y = [1, 82, 82]. Received [333] in X is not equal to [82] in Y at i:3.
[Hint: Expected x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1 == true, but received x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1:0 != true:1.] (at /paddle/paddle/phi/kernels/funcs/common_shape.h:84)
Traceback (most recent call last):
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddlespeech/cli/asr/infer.py", line 314, in infer
result_transcripts = self.model.decode(
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddle/fluid/dygraph/base.py", line 375, in _decorate_function
return func(*args, **kwargs)
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddlespeech/s2t/models/u2/u2.py", line 819, in decode
hyp = self.attention_rescoring(
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddlespeech/s2t/models/u2/u2.py", line 544, in attention_rescoring
hyps, encoder_out = self._ctc_prefix_beam_search(
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddlespeech/s2t/models/u2/u2.py", line 425, in _ctc_prefix_beam_search
encoder_out, encoder_mask = self._forward_encoder(
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddlespeech/s2t/models/u2/u2.py", line 230, in _forward_encoder
encoder_out, encoder_mask = self.encoder(
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddle/fluid/dygraph/layers.py", line 1012, in call
return self.forward(*inputs, **kwargs)
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddlespeech/s2t/modules/encoder.py", line 181, in forward
chunk_masks = add_optional_chunk_mask(
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddlespeech/s2t/modules/mask.py", line 202, in add_optional_chunk_mask
chunk_masks = masks.logical_and(chunk_masks) # (B, L, L)
File "~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddle/tensor/logic.py", line 122, in logical_and
return _C_ops.logical_and(x, y)
ValueError: (InvalidArgument) Broadcast dimension mismatch. Operands could not be broadcast together with the shape of X = [1, 1, 0, 333] and the shape of Y = [1, 82, 82]. Received [333] in X is not equal to [82] in Y at i:3.
[Hint: Expected x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1 == true, but received x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1:0 != true:1.] (at /paddle/paddle/phi/kernels/funcs/common_shape.h:84)
KeyError: 'result' 所用系统为ubuntu22.04,完全按照官方说明安装的,麻烦帮忙看下是什么问题,谢谢!
不知道为什么问题描述部分的一些文字会出现删除线
不知道为什么问题描述部分的一些文字会出现删除线
这个问题,我前几天也遇到了,原因是版本问题。我将分支切换到r1.4,paddlepaddle-gpu用2.4.0,成功解决该问题。
不知道为什么问题描述部分的一些文字会出现删除线
这个问题,我前几天也遇到了,原因是版本问题。我将分支切换到r1.4,paddlepaddle-gpu用2.4.0,成功解决该问题。
是的,测试了1.4版本,确实可以用汉语正常生成语音,语音转文字。但是在用官方提供的en.wav转换文字时遇到了新的问题,报错如下; AssertionError: Can't find "conformer_u2pp_online_wenetspeech-en-16k" in resource. Model name must be one of ['conformer_wenetspeech-zh-16k', 'conformer_online_wenetspeech-zh-16k', 'conformer_u2pp_online_wenetspeech-zh-16k', 'conformer_online_multicn-zh-16k', 'conformer_aishell-zh-16k', 'conformer_online_aishell-zh-16k', 'transformer_librispeech-en-16k', 'deepspeech2online_wenetspeech-zh-16k', 'deepspeech2offline_aishell-zh-16k', 'deepspeech2online_aishell-zh-16k', 'deepspeech2offline_librispeech-en-16k', 'conformer_talcs-codeswitch_zh_en-16k']
不知道为什么问题描述部分的一些文字会出现删除线
这个问题,我前几天也遇到了,原因是版本问题。我将分支切换到r1.4,paddlepaddle-gpu用2.4.0,成功解决该问题。
conda install paddlepaddle-gpu==2.4.0 cudatoolkit=11.7 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ -c conda-forge 使用此命令安装的话安装好以后会报错 输入import paddle验证,报错如下 Error: Can not import paddle core while this file exists: ~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddle/fluid/libpaddle.so
不知道为什么问题描述部分的一些文字会出现删除线
这个问题,我前几天也遇到了,原因是版本问题。我将分支切换到r1.4,paddlepaddle-gpu用2.4.0,成功解决该问题。
如果方便的话还请您给一个可以正常运行的安装命令,感谢~ 安装到崩溃。。。。。。
不知道为什么问题描述部分的一些文字会出现删除线
这个问题,我前几天也遇到了,原因是版本问题。我将分支切换到r1.4,paddlepaddle-gpu用2.4.0,成功解决该问题。
conda install paddlepaddle-gpu==2.4.0 cudatoolkit=11.7 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/ -c conda-forge 使用此命令安装的话安装好以后会报错 输入import paddle验证,报错如下 Error: Can not import paddle core while this file exists: ~/anaconda3/envs/paddle_env/lib/python3.9/site-packages/paddle/fluid/libpaddle.so
可以看看这个是否能解决你的问题: https://github.com/PaddlePaddle/PaddleNLP/pull/3859
同样的问题ubuntu系统切换到r1.4分支,paddle2.4依然无法运行asr。请问如何解决
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is closed. Please re-open if needed.