PaddlePaddle / Paddle2ONNX

ONNX Model Exporter for PaddlePaddle
Apache License 2.0
738 stars 173 forks source link

unstack, one_hot, diag, logical_not op 不支持 #315

Closed ma-biao closed 6 months ago

ma-biao commented 3 years ago

将D-NET的三个预训练模型(Bert, ERNIE2.0, XLNET)保存的模型文件转为onnx时,都会报错缺少op,BERT和ERNIE2.0缺少unstack,XLNET缺少one_hot, diag, top_k, logical_not。

paddlepaddle==2.1.2 paddle2onnx==0.7

Traceback (most recent call last): File "/home/common/anaconda3/envs/paddle/bin/paddle2onnx", line 8, in sys.exit(main()) File "/home/common/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle2onnx/command.py", line 142, in main enable_onnx_checker=args.enable_onnx_checker) File "/home/common/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle2onnx/command.py", line 114, in program2onnx enable_onnx_checker=enable_onnx_checker) File "/home/common/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle2onnx/convert.py", line 77, in program2onnx export_onnx(paddle_graph, save_file, opset_version, enable_onnx_checker) File "/home/common/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle2onnx/convert.py", line 32, in export_onnx onnx_graph = ONNXGraph.build(paddle_graph, opset_version, verbose) File "/home/common/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle2onnx/graph/onnx_graph.py", line 229, in build onnx_graph.build_op_nodes(paddle_graph.node_map) File "/home/common/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle2onnx/graph/onnx_graph.py", line 183, in build_op_nodes OpMapper.check_support_status(node_map, self.opset_version) File "/home/common/anaconda3/envs/paddle/lib/python3.7/site-packages/paddle2onnx/op_mapper/op_mapper.py", line 144, in check_support_status raise NotImplementedError(error_info) NotImplementedError: There's 4 ops are not supported yet =========== one_hot =========== =========== diag =========== =========== top_k =========== =========== logical_not ===========

yeliang2258 commented 3 years ago

你好,请问转换模型是用于用于什么场景?另外请提供一下模型。

ma-biao commented 3 years ago

你好,转换模型主要用于生成onnx,使得在其他环境下能够加载对应的预训练模型。 D-Net模型https://github.com/PaddlePaddle/Research/tree/master/NLP/MRQA2019-D-NET/server,主体是这里的server,按照README可以下载三个预训练模型(wget --no-check-certificate https://baidu-nlp.bj.bcebos.com/D-Net/mrqa2019_inference_model.tar.gz)。

------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/Paddle2ONNX" @.>; 发送时间: 2021年9月8日(星期三) 下午2:06 @.>; @.**@.>; 主题: Re: [PaddlePaddle/Paddle2ONNX] unstack, one_hot, diag, logical_not op 不支持 (#315)

你好,请问转换模型是用于用于什么场景?另外请提供一下模型。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

yeliang2258 commented 3 years ago

你好,此模型是老版本的NLP模型,我们目前支持的模型是2.0以上的飞桨模型,建议你使用最新的PaddleNLP。 链接:https://github.com/PaddlePaddle/PaddleNLP

ma-biao commented 3 years ago

好的,感谢反馈。

------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/Paddle2ONNX" @.>; 发送时间: 2021年9月9日(星期四) 下午2:39 @.>; @.**@.>; 主题: Re: [PaddlePaddle/Paddle2ONNX] unstack, one_hot, diag, logical_not op 不支持 (#315)

你好,此模型是老版本的NLP模型,我们目前支持的模型是2.0以上的飞桨模型,建议你使用最新的PaddleNLP。 链接:https://github.com/PaddlePaddle/PaddleNLP

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.