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:20240208
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:20240208 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 be0
- Concat
- Conv
- Cos
- Div
- 1st input must not be
"constant"
- 1st input must not be
- Dropout
- equivalent identity function
- Elu
- Exp
- Flatten
- Gemm
- GlobalAveragePool
- HardSigmoid
- 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
must be array of 1.
- Mul
- Pad
mode
must be"constant"
- Pow
- 2nd input must be
2.0
- 2nd input must be
- 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
- Slice
- Softmax
- Split
- Squeeze
- Sub
- 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.4.0.tar.gz
(21.1 kB
view details)
Built Distribution
File details
Details for the file nnoir_onnx-1.4.0.tar.gz
.
File metadata
- Download URL: nnoir_onnx-1.4.0.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.17 Linux/5.15.0-1057-aws
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc53555745962f80e64fdb6b7ea9780f16820b5caa10cf92c7bf490b5359ccd0 |
|
MD5 | 47bfba74d043554cbc4f672b53cdb60f |
|
BLAKE2b-256 | be45b0328d4477888e9a7891e5654ec432cb87ab93c01f6938c6e9c300f47fbe |
File details
Details for the file nnoir_onnx-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: nnoir_onnx-1.4.0-py3-none-any.whl
- Upload date:
- Size: 41.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.17 Linux/5.15.0-1057-aws
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05eb6b8cd034ab2200d4ea702a04886aeb0116dd83b759c525abe624defbde71 |
|
MD5 | 81f1abaa61b8ab3f9b6dbb6fecc75143 |
|
BLAKE2b-256 | ee52b88038168e18c8114ce9a841b0aab4cfad920b8a9f3c3530a9d58110b936 |