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
- Sqrt
- Squeeze
- Sub
- Sum
- 2 inputs
- Tan
- Tanh
- Transpose
- Unsqueeze
- Where
condition
must be Constant valuecondition
must all true or all false- the input value not selected must be constant
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.5.0.tar.gz
(21.8 kB
view details)
Built Distribution
File details
Details for the file nnoir_onnx-1.5.0.tar.gz
.
File metadata
- Download URL: nnoir_onnx-1.5.0.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.9.17 Linux/5.15.0-1057-aws
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
a78c7ebdc47aa629cbcd169a38890bdfc2898e849164c95e95c92ccc6b72324c
|
|
MD5 |
7f1ba7b65b8d476c433af1fa74469f63
|
|
BLAKE2b-256 |
ac8731809ef86a073a8ec1d21a195f4e9fbec6f8ba3b0ddf6f1671be5ddc9f45
|
File details
Details for the file nnoir_onnx-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: nnoir_onnx-1.5.0-py3-none-any.whl
- Upload date:
- Size: 43.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.9.17 Linux/5.15.0-1057-aws
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
849d3d8a43f6c2dd80ec5f01fa86175324ae6e9dd121afb8c255996d72c5af42
|
|
MD5 |
6e24ed738f71cb428429d36a5f533427
|
|
BLAKE2b-256 |
387f8e19b720f86cd7031475a0ab42f2c5af526afb634504522d6773b978a509
|