Code Monkey home page Code Monkey logo

lijiaqi0612 / uie-acl-310 Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 7.0 158 KB

有一个通用实体关系事件抽取的任务,需要使用到UIE模框架,而且需要将起部署到昇腾310服务器上,因为UIE模型底层使用的是ernie3.0,但是目前paddle官方还不支持ernie3.0模型在昇腾310上部署,所以才有了以下的操作,主要过程是,先试用paddle训练处模型,然后使用 paddle2onnx.command.c_paddle_to_onnx方法将paddle的模型转为onnx模型 ,因现在的onnx模型是动态的shape和散乱的算子形态,需要使用paddle自带的工具paddle2onnx.optimize将onnx模型先进行重塑,固定好shape的维度,将散乱的算子进行整合,命令如下: $ python -m paddle2onnx.optimize --input_model /home/user/lijiaqi/PaddleNLP/model_zoo/uie/export_new/model.onnx --output_model /home/user/lijiaqi/model_new_uie.onnx --input_shape_dict "{'att_mask':[1,512],'pos_ids':[1,512],'token_type_ids':[1,512],'input_ids':[1,512]}" 然后将onnx模型在使用ATC工具转为acl所需要的om模型,这一步后面会讲。 另外在使用acl部署的时候,paddle框架是不能使用的,acl使用到的模型和训练过程均需要自己实现,包括from_pretrain阶段的分词,建立词表,数据处理部分,这部分我已经实现完,纯python版本的实现

Python 100.00%

uie-acl-310's People

Contributors

lijiaqi0612 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uie-acl-310's Issues

关于onnx模型转om报错

大佬您好,最近在做paddlenlp的实体识别UIE模型通过onnx转om,按您的方法,执行了onnx模型重塑后,使用atc将重塑后的onnx转om过程出现了报错E16005: The model has [2] [--domain_version] fields, but only one is allowed.Model parse to graph failed,不知道您有没有遇到过,如果可以,不吝赐教

aarch64 架构的onnx转om模型失败,能否上传一版已经转好的om模型

报错如下:
(base) [root@guest backup]# atc --model=./model_new_uie.onnx --framework=5 --output=./model_uie_om --soc_version=Ascend310
ATC start working now, please wait for a moment.
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E16005: The model has [2] [--domain_version] fields, but only one is allowed.
TraceBack (most recent call last):
Model parse to graph failed, graph name:model_uie_om.[FUNC:ModelParseToGraph][FILE:onnx_parser.cc][LINE:924]
ATC model parse ret fail.[FUNC:ParseGraph][FILE:omg.cc][LINE:791]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.