PaddlePaddle / X2Paddle

Deep learning model converter for PaddlePaddle. (『飞桨』深度学习模型转换工具)
http://www.paddlepaddle.org/
Apache License 2.0
740 stars 165 forks source link

转换conformer模型识别 #882

Open gyb4git opened 2 years ago

gyb4git commented 2 years ago

问题描述

D:\project2022\paddle_server\conformer_paddle>x2paddle --framework=onnx --model=model.average.finetune.3.ep.onnx --save_dir=conformer_pd_model C:\Users\user\AppData\Roaming\Python\Python39\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp, sys, os INFO 2022-08-23 14:23:22,774 convert.py:431] paddle.version = 2.3.1 INFO 2022-08-23 14:23:22,794 convert.py:285] Now translating model from onnx to paddle. model ir_version: 6, op version: 11 Unknown shape for input tensor[tensor name: 'x2paddle_xs_pad'] -> shape: ['batch_size', 'ilen', 40], Please define shape of input here, Note:you can use visualization tools like Netron to check input shape. Shape of Input(e.g. -1,3,224,224), enter 'N' to skip: 1,4000,40 Unknown shape for input tensor[tensor name: 'x2paddle_xs_mask'] -> shape: ['batch_size', 1, 'ilen'], Please define shape of input here, Note:you can use visualization tools like Netron to check input shape. Shape of Input(e.g. -1,3,224,224), enter 'N' to skip: 1,1,4000 shape inferencing ... [WARNING] Incomplete symbolic shape inference shape inferenced. Traceback (most recent call last): File "C:\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Python\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\user\AppData\Roaming\Python\Python39\Scripts\x2paddle.exe__main.py", line 7, in File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\x2paddle\convert.py", line 475, in main onnx2paddle( File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\x2paddle\convert.py", line 289, in onnx2paddle model = ONNXDecoder(model_path) File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\x2paddle\decoder\onnx_decoder.py", line 429, in init self.graph = ONNXGraph(onnx_model) File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\x2paddle\decoder\onnx_decoder.py", line 193, in init__ self.collect_value_infos() File "C:\Users\user\AppData\Roaming\Python\Python39\site-packages\x2paddle\decoder\onnx_decoder.py", line 390, in collect_value_infos TENSOR_TYPE_TO_NP_TYPE[item.type.tensor_type.elem_type], KeyError: 0

具体信息

转换conformer模型用于昆仑卡R200下PaddleLite进行推理 x2paddle --framework=onnx --model=conformer_xxxx.onnx --save_dir=conformer_pd_model

wjj19950828 commented 2 years ago

@gyb4git 麻烦提供一下onnx模型吧

另外,可以描述一下以下两个问题吗: 1、具体业务场景 2、为什么有转到Paddle部署的需求呢?

感谢~

gyb4git commented 2 years ago

@gyb4git 麻烦提供一下onnx模型吧

另外,可以描述一下以下两个问题吗: 1、具体业务场景 进行语音识别 2、为什么有转到Paddle部署的需求呢? 有客户合作项目用到kunlun XPU,需要将onnx模型转换到paddle下推理,因为目前训练环境是pytorch conformer模型地址 链接: https://pan.baidu.com/s/189UjlUTtGi_JWkmGx5YP3A 提取码: iztu

感谢~