ONNX to NNOIR Converter
Project description
nnoir-onnx
nnoir-onnx is a converter from ONNX model to NNOIR model.
Install
From PyPI:
pip install nnoir-onnx
From Dockerhub:
docker pull idein/nnoir-tools:20230306
Example
wget https://www.cntk.ai/OnnxModels/mnist/opset_7/mnist.tar.gz
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:20230306 onnx2nnoir --graph_name "mobilenet" -o mobilenetv2-1.0.nnoir mobilenetv2-1.0.onnx
Supported ONNX Operators
- Add
- AveragePool
- BatchNormalization
scale
,B
,mean
, andvar
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
- Cos
- Div
- 1st input must not be
"constant"
- 1st input must not be
- Dropout
- equivalent identity function
- Elu
- Exp
- Flatten
- Gemm
- GlobalAveragePool
- HardSwish
- LeakyRelu
- LRN
- LSTM
- only
seq_length == 1
direction
must be forward- Supported
activations
are belowSigmoid
Tanh
Relu
- Not support
clip
andinput_forget
- only
- MatMul
- MaxPool
ceil_mode = 1
is not supporteddilations
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"
modecoordinate_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"
- 1st input must not be
- Sum
- 2 inputs
- Tan
- Tanh
- Transpose
- Unsqueeze
Project details
Release history Release notifications | RSS feed
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.1.0.tar.gz
(19.1 kB
view hashes)
Built Distribution
nnoir_onnx-1.1.0-py3-none-any.whl
(33.9 kB
view hashes)
Close
Hashes for nnoir_onnx-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2026f86b988c154b56c2213f8a9a630a2698ff662d7cc31bef6ec91aabf4506d |
|
MD5 | 9e9d5a0e6beeeccf68f8143e8f0c58b3 |
|
BLAKE2b-256 | 607afb9654cce17216ffdfbd414dff0da61294999e7f8e096df1028fb6ea1136 |