onnx.onnx_cpp2py_export.checker.ValidationError

onnx.onnx cpp2py export Yeah. checker.ValidationError

“25253rd;”381693rd;”

    import mxnet as mx
    import numpy as np
    from mxnet.contrib import onnx as onnx_mxnet
    import logging

    logging.basicConfig(level=logging.INFO)
    from onnx import checker
    import onnx

    syms = './mxnet/new_model-symbol.json'
    params = './mxnet/new_model-0000.params'

    input_shape = (1, 3, 112, 112)

    onnx_file = './mnist.onnx'

    # Invoke export model API. It returns path of the converted onnx model
    converted_model_path = onnx_mxnet.export_model(syms, params, [input_shape], np.float32, onnx_file)

    # Load onnx model
    model_proto = onnx.load_model(converted_model_path)

Online solution: pip install onnx==1.5.0
After the change, more errors are reported.
onnx.onnx_cpp2py_export.checker.ValidationError: Unrecognized attribute: spatial for operator BatchNormalization
==> Context: Bad node spec: input: “conv_1_conv2d” input: “conv_1_batchnorm_gamma” input: “conv_1_batchnorm_beta” input: “conv_1_batchnorm_moving_mean” input: “conv_1_batchnorm_moving_var” output: “conv_1_batchnorm” name: “conv_1_batchnorm” op_type: “BatchNormalization” attribute { name: “epsilon” f: 0.001 type: FLOAT } attribute { name: “momentum” f: 0.9 type: FLOAT } attribute { name: “spatial” i: 0 type: INT }

Read More: