apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.79k stars 6.79k forks source link

Unsuported operator when importing an ONNX model #18970

Open wangzbo opened 4 years ago

wangzbo commented 4 years ago

Description

Hello,

I am using mxnet to import a onnx model exported by pytorch and it failed with the error message below. Is there any plan to support the ConstantOfShape operator? Does mxnet support to import a pytorch model with dynamic input/output shapes? Thanks.

python: 3.7.6 pytorch: 1.6.0 opset_version: 11 mxnet: 1.6.0 OS: macOS mojave

Error Message

sym, arg, aux = mxnet.contrib.onnx.import_model("nl2sql.onnx")

File "/usr/local/lib/python3.7/site-packages/mxnet/contrib/onnx/onnx2mx/import_model.py", line 59, in import_model sym, arg_params, aux_params = graph.from_onnx(model_proto.graph) File "/usr/local/lib/python3.7/site-packages/mxnet/contrib/onnx/onnx2mx/import_onnx.py", line 116, in from_onnx mxnet_sym = self._convert_operator(node_name, op_name, onnx_attr, inputs) File "/usr/local/lib/python3.7/site-packages/mxnet/contrib/onnx/onnx2mx/import_onnx.py", line 64, in _convert_operator raise NotImplementedError("Operator {} not implemented.".format(op_name)) NotImplementedError: Operator ConstantOfShape not implemented.

To Reproduce

(If you developed your own code, please provide a short script that reproduces the error. For existing examples, please provide link.)

Steps to reproduce

(Paste the commands you ran that produced the error.)

1. 2.

What have you tried to solve it?

1. 2.

Environment

We recommend using our script for collecting the diagnositc information. Run the following command and paste the outputs below:

curl --retry 10 -s https://raw.githubusercontent.com/dmlc/gluon-nlp/master/tools/diagnose.py | python

# paste outputs here
github-actions[bot] commented 4 years ago

Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue. Please make sure to include all the relevant context, and one of the @apache/mxnet-committers will be here shortly. If you are interested in contributing to our project, let us know! Also, be sure to check out our guide on contributing to MXNet and our development guides wiki.

pribadihcr commented 1 year ago

any solution?