Replies: 7 comments
-
|
Thanks for opening this issue @xhappy |
Beta Was this translation helpful? Give feedback.
-
|
I met the same problem. |
Beta Was this translation helpful? Give feedback.
-
|
Maybe using gluon api to implemet the algorithm can solve the problem directly. |
Beta Was this translation helpful? Give feedback.
-
|
@xhappy @lizhen2017 could you share the model that you are using for testing |
Beta Was this translation helpful? Give feedback.
-
|
please verify with the PR #12878 |
Beta Was this translation helpful? Give feedback.
-
|
I had the same problem. First, I manually changed symbol.json file by adding to it the key "attrs" with the following parameters {"axis": "1", "eps": "1e-03", "fix_gamma": "True", "momentum": "0.9", "use_global_stats": "False"}. But after convertation the output in onnx was different from the output of the original model. |
Beta Was this translation helpful? Give feedback.
-
|
Could you share the symbol and params files that you used? @xhappy @lizhen2017 @allgrom |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.
For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io
Description
(Brief description of the problem in no more than 2 sentences.)
When I converted mxnet model to onnx model format, occurred following exception:
[09:26:11] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.2.0. Attempting to upgrade...
[09:26:11] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
{'name': 'batchnorm-0', 'op': 'BatchNorm', 'inputs': [[3, 0, 0], [4, 0, 0], [5, 0, 0], [6, 0, 1], [7, 0, 1]]}
Traceback (most recent call last):
File "mxnet2onnx.py", line 29, in
converted_model_path = onnx_mxnet.export_model(sym, params, data_shapes, np.float32, onnx_file)
File "/home/code/mxnet/python/mxnet/contrib/onnx/mx2onnx/export_model.py", line 77, in export_model
verbose=verbose)
File "/home/code/mxnet/python/mxnet/contrib/onnx/mx2onnx/export_onnx.py", line 282, in create_onnx_graph_proto
idx=idx
File "/home/code/mxnet/python/mxnet/contrib/onnx/mx2onnx/export_onnx.py", line 92, in convert_layer
return convert_func(node, **kwargs)
File "/home/code/mxnet/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py", line 254, in convert_batchnorm
attrs = node["attrs"]
KeyError: 'attrs'
I have checked that the codes line 254 in /home/code/mxnet/python/mxnet/contrib/onnx/mx2onnx/_op_translations.py file, I printed the node variable as following:
{'name': 'batchnorm-0', 'op': 'BatchNorm', 'inputs': [[3, 0, 0], [4, 0, 0], [5, 0, 0], [6, 0, 1], [7, 0, 1]]}
It don't exist the key "attrs".
I also checked the model-symbol.json, found that the layer BatchNorm as following, don't exist the key "attrs".
{
"op": "BatchNorm",
"name": "batchnorm-0",
"inputs": [[3, 0, 0], [4, 0, 0], [5, 0, 0], [6, 0, 1], [7, 0, 1]]
},
Could you please help to fix this issue? Thanks a lot.
Environment info (Required)
Debian 9.0
Package used (Python/R/Scala/Julia):
(I'm using ...)
For Scala user, please provide:
java -version)mvn -version)scala -version)For R user, please provide R
sessionInfo():Build info (Required if built from source)
Compiler (gcc/clang/mingw/visual studio):
MXNet commit hash:
(Paste the output of
git rev-parse HEADhere.)Build config:
(Paste the content of config.mk, or the build command.)
Error Message:
(Paste the complete error message, including stack trace.)
Minimum reproducible example
(If you are using your own code, please provide a short script that reproduces the error. Otherwise, please provide link to the existing example.)
Steps to reproduce
(Paste the commands you ran that produced the error.)
Beta Was this translation helpful? Give feedback.
All reactions