-
Notifications
You must be signed in to change notification settings - Fork 30
MXNetError: Invalid Parameter format for shape expect Shape(tuple) but value='<Symbol identity1>', in operator Reshape(name="", shape="<Symbol identity1>") #50
Comments
@spidydev to take a look |
ONNX changed the definition for Reshape op after in the latest master. Pytorch has already incorporated the change in pytorch/caffe export, hence the problem. @anirudhacharya is already working on a solution as MXNET reshape operator doesnt match with new ONNX definition. |
@spidydev Is it possible that I roll back onnx to a old version to bypass this problem |
this is from onnx ONNX_OPERATOR_SET_SCHEMA( |
@glingyan The issue should be resolved in latest MXNet (please install using : pip install mxnet --pre) The problem was "shape" input was previously an "attribute" in reshape operator(https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Reshape-1). Also, MXNet always expects the "shape" as an attribute not a input symbol. This scenario has been handle in the latest MXNet now (master). Rolling back ONNX woudn't help as pytorch converted ONNX model will have "shape" as input, so needs handling in import code to be fixed. |
@spidydev I already use latest mxnet, the Branches: master, remotes/origin/marcoabreu-patch-1, remotes/origin/master
|
this is the error I got |
this is the onnx out |
sorry forgot to mention, as this repo is deprecated , all our fixes goes in the import module inside mxnet. please use http://mxnet.incubator.apache.org/versions/1.2.0/api/python/contrib/onnx.html for reference and usage. |
@spidydev thanks, I already use latest mxnet |
@glingyan Are you using the import module we added inside latest MXNet. |
yes, my code is simple """Testing super_resolution model conversion""" import mxnet as mx set up loggerlogging.basicConfig() def import_onnx(): if name == 'main': |
could you tell me which patch in mxnet is to fix this , I will add print to double check |
the reshape operator convertor (https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/contrib/onnx/_import/op_translations.py#L346) was expected to fix this, but we need to look what is the issue. |
just checked my code , seems do not have this patch , will update and report to you |
still have problem reshape_shape = list(proto_obj._params[inputs[1].name].asnumpy()) |
Thanks @glingyan for the details. We are looking into the issue. |
Had the problem already been fixed ?, anyone can tell me how to solve it, Thank you |
@lxy5513 this repo is deprecated, functionality is now built into mxnet. |
I use the example from
https://github.com/onnx/tutorials/blob/master/tutorials/PytorchCaffe2SuperResolution.ipynb
to export super_resolution.onnx
and run in MXNET , this error occurs
I did run programming with GPU on Jupyter notebook
Error Message(Import model with MXNET)
this is my export model code
this is my import model code
my Python Environment
python 3.6.3
apt-get install protobuf-compiler libprotoc-dev
pip install git+https://github.com/onnx/onnx.git@master
and I try to do
pip install onnx-mxnet
pip install Pillow
and
git clone https://github.com/onnx/onnx-mxnet.git
cd onnx-mxnet
sudo python setup.py install
but both of two methods occurred the same error
Could you please advice how to solve out this error
Thank you
The text was updated successfully, but these errors were encountered: