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:
- [Solved] ONNXImporter::handleNode DNN/ONNX和create layer “onnx::Gather_384“ of type “NonMaxSuppression“
- [Solved] Could not find a version that satisfies the requirement onnx (from onnx-graphsurgeon0.2.6)
- onnx-tensorrt/builtin_op_importers.cpp:766:12: error: ‘class nvinfer1::IDeconvolutionLayer’ has no m
- Using onnx to deploy models in mmdetection
- Ubuntu has solved the error of h5py installation: building wheel for h5py( setup.py )… or error: failed building wheel for h5py
- Python how does a. Py file call classes and functions in another. Py file
- PY3 install box2d PY
- Altium designer 18: failed to export
- How to Use paho.mqtt.cpp
- Clion compiles and runs a single C / cpp file
- Unity Android failed to extract resources needed byil2cpp
- configure: error: C++ preprocessor “/lib/cpp” fails sanity check
- Python export data (CSV format)
- Export and import method of MySQL under Linux
- Datagrip import & export table structure and data
- The solution of “failed to load il2cpp” in Android package launched by unity
- Bad file descriptor(C:\ci\zeromq 1602704446950\work\src\epoll.cpp:100)
- About “undefined reference to” when compiling uboot__ aeabi_ unwind_ cpp_ The solution of “PR0 ‘”
- ERROR: ../tSafe/coreReadArchive.cpp (38) – Serialization Error in verifyHeader: 0 (Version tag does
- main.cpp : (. Text + 0xd06): undefined reference to XX method | simple record