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 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
- 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
is not supported
- Mul
- Pad
mode
must be"constant"
- Pow
- 2nd input must not be
"constant"
- 2nd input must not 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
- Softmax
- Split
- 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.3.0.tar.gz
(20.5 kB
view hashes)
Built Distribution
nnoir_onnx-1.3.0-py3-none-any.whl
(40.1 kB
view hashes)
Close
Hashes for nnoir_onnx-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8edf587b12205627921e7dcfd06df0aab2b4e08c76bf792260013ac7c7e4a22f |
|
MD5 | 9ef638a01ea782100840c176ace10b66 |
|
BLAKE2b-256 | 07d859fcf937b7392ae9948635e2f96fa80d68920f6d15eb98a739bb75edeeb3 |