Skip to main content

ONNX to NNOIR Converter

Project description


nnoir-onnx is a converter from ONNX model to NNOIR model.


From PyPI:

pip install nnoir-onnx

From Dockerhub:

docker pull idein/nnoir-tools:20221014


tar xvzf mnist.tar.gz
onnx2nnoir -o model.nnoir mnist/model.onnx

With docker:

docker run --rm -it -u $UID:$GID -v $(pwd):/work idein/nnoir-tools:20221014 onnx2nnoir --graph_name "mobilenet" -o mobilenetv2-1.0.nnoir mobilenetv2-1.0.onnx

Supported ONNX Operators

  • Add
  • AveragePool
  • BatchNormalization
    • scale, B, mean, and var must be "constant"
  • Clip
    • must be opset version 6 or 11
    • if opset version is 11
      • max must be "constant"
    • min must be 0
  • Concat
  • Conv
    • W must be Constant value or have initializer value
    • b must be Constant value or have initializer value
  • Cos
  • Div
    • 1st input must not be "constant"
  • Dropout
    • equivalent identity function
  • Elu
  • Exp
  • Flatten
  • Gemm
    • B must be Constant value or have initializer value
    • C must be Constant value or have initializer value
  • GlobalAveragePool
  • LeakyRelu
  • LRN
  • LSTM
    • only seq_length == 1
    • direction must be forward
    • Supported activations are below
      • Sigmoid
      • Tanh
      • Relu
    • Not support clip and input_forget
  • MatMul
  • MaxPool
    • ceil_mode = 1 is not supported
    • dilations is not supported
  • Mul
  • Pad
    • mode must be "constant"
  • PRelu
    • slope must be "constant" and a single value tensor
  • ReduceMean
  • ReduceSum
  • Relu
  • Reshape
  • Resize
    • must be from opset version >= 11
    • mode must be "linear" or "nearest"
    • nearest_mode must be "floor"
    • coordinate_transformation_mode must be either "pytorch_half_pixel" or "align_corners" for "linear" mode
    • coordinate_transformation_mode must be either "asymmetric" for "nearest" mode
  • Sigmoid
  • Sin
  • Softmax
  • Split
    • must be from opset version >= 13
    • Second optional parameter split is not supported
  • Squeeze
  • Sub
    • 1st input must not be "constant"
  • Sum
    • 2 inputs
  • Tan
  • Tanh
  • Transpose
  • Unsqueeze

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nnoir_onnx-1.0.17.tar.gz (19.5 kB view hashes)

Uploaded source

Built Distribution

nnoir_onnx-1.0.17-py3-none-any.whl (33.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page