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 <module>
    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
```
What to do:
1. Download the diagnosis script from 
https://raw.githubusercontent.com/apache/incubator-mxnet/master/tools/diagnose.py
2. Run the script using `python diagnose.py` and paste its output here.
----------Python Info----------
Version      : 3.5.3
Compiler     : GCC 6.3.0 20170118
Build        : ('default', 'Jan 19 2017 14:11:04')
Arch         : ('64bit', '')
------------Pip Info-----------
Version      : 9.0.1
Directory    : /usr/lib/python3/dist-packages/pip
----------MXNet Info-----------
Version      : 1.3.0
Directory    : /home/code/mxnet/python/mxnet
Hashtag not found. Not installed from pre-built package.
----------System Info----------
Platform     : Linux-4.9.0-8-amd64-x86_64-with-debian-9.5
system       : Linux
node         : bsalgo-gpu4.jd.163.org
release      : 4.9.0-8-amd64
version      : #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21)
----------Hardware Info----------
machine      : x86_64
processor    : 
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                56
On-line CPU(s) list:   0-55
Thread(s) per core:    2
Core(s) per socket:    14
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 79
Model name:            Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz
Stepping:              1
CPU MHz:               2401.000
CPU max MHz:           2401.0000
CPU min MHz:           1200.0000
BogoMIPS:              4800.08
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              35840K
NUMA node0 CPU(s):     0-13,28-41
NUMA node1 CPU(s):     14-27,42-55
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx 
pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology 
nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 
ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt 
tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb 
invpcid_single tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 
hle avx2 smep bmi2 erms invpcid rtm cqm rdseed adx smap intel_pt xsaveopt 
cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp
----------Network Test----------
Setting timeout: 10
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0046 sec, LOAD: 
2.7534 sec.
Timing for FashionMNIST: 
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz,
 DNS: 3.3881 sec, LOAD: 5.2034 sec.
Timing for Gluon Tutorial(cn): https://zh.gluon.ai, DNS: 2.1912 sec, LOAD: 
5.2533 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0039 sec, LOAD: 
0.9699 sec.
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0041 sec, 
LOAD: 0.8572 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 1.6017 sec, LOAD: 
1.8096 sec.
```

Package used (Python/R/Scala/Julia):
(I'm using ...)

For Scala user, please provide:
1. Java version: (`java -version`)
2. Maven version: (`mvn -version`)
3. Scala runtime if applicable: (`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 HEAD` here.)

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.)

1.
2.



[ Full content available at: 
https://github.com/apache/incubator-mxnet/issues/12514 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to