Scailable.
Search…
⌃K

ONNX requirements

In previous sections we detailed how to create ONNX graphs from scratch (including providing a large number of examples in the sclblonnx package). Alternatively you can also export your trained model from you favourite training platform. In both of these cases, you will end up with an .onnx file that you would like to upload to the Scailable platform for deployment. For the automatic conversion of the ONNX graph to SPMF we technically support a subset of ONNX. This page describes how to check your ONNX graph and ensure that it fits the Scailable platform requirements for deployment.
Note that the sclblonnx package (git, pip), provides functions to automatically check locally whether or not your onnx file adheres to the Scailable requirements.

Requirements for the ONNX graph

Here we list all the requirements that your ONNX graph should adhere to before uploading it to the Scailable platform:
  • Inputs: As we currently (publicly) provide support solely for vision models (i.e., models that operate on images), ONNX graphs uploaded to our platform should have an image tensor as input. We support two options for the input tensor of the image input to the model:
    • (n)chw: I.e., an encoding (optionally) the number of images n (which should be set to 1), the number of color channels c (1 for grayscale, 3 for color) and next the width w and the height h of the impnut image.
    • (n)hwc: Similar to the above, but the order of channels and pixels changed.
    Note that if the ONNX graph has a single input, the AI manager will try to fit the input image grabbed from the camera to this input. However, ideally, the image input to the graph is explicitly named and has a image- prefix (see also our named model inputs and outputs).
We recommend using Netron to visually inspect your ONNX graph to ensure that the input and outputs match the descriptions provided here.
If you have a licensed account and would like to upload larger models, please reach out to our support team using our chat and we will increase the limit for your account.
Please bear in mind that you will be deploying your AI model and pipeline specified in your ONNX graph to an edge device with contstrained resources. Always test the performance of your pipeline on your target device before production deployment.
  • Data type(s): We support all data types in the ONNX graph with the exception of STRING. Furthermore, we currently only support static (fixed) sized tensors throughout the graph. P
Note that we do provide highly efficient OCR as a post-processing option within the AI manager.​

Automatic checking using the sclblonnx check() function

You can use the sclblonnx package to provide automatic checks of your ONNX graph. Please always run the following before uploading:

Graph cleaning

You can easily clean up your graph (which also tries to optimise the graph wherever possible).
import sclblonnx as so
graph = so.clean(graph)

Graph checking

The check function automatically checks whether the ONNX graph adheres to our requirements:
import sclblonnx as so
so.check(graph)

Graph testing

You should always test your graph locally:
import sclblonnx as so
​
// code to construct graph g with outuput node sum and input example e.
​
result = so.run(g,
inputs=e,
outputs=["sum"]
)
print(result)
You can find more information regarding the sclblonnx package here.

List of supported operators

Here we provide a list of all the operators we support for ONNX to SPMF conversion:

ai.onnx (default)

Operator
Opset 11/13
​Abs​
✔ï¸
​Acos​
✔ï¸
​Acosh​
✔ï¸
​Add​
✔ï¸
​And​
✔ï¸
​ArgMax​
✔ï¸
​ArgMin​
✔ï¸
​Asin​
✔ï¸
​Asinh​
✔ï¸
​Atan​
✔ï¸
​Atanh​
✔ï¸
​AveragePool​
✔ï¸
​BatchNormalization​
✔ï¸
​BitShift​
✔ï¸
​Cast​
✔ï¸
​Ceil​
✔ï¸
​Clip​
✔ï¸
​Compress​
✔ï¸
​Concat​
✔ï¸
​ConcatFromSequence​
​
​Constant​
✔ï¸
​ConstantOfShape​
✔ï¸
​Conv​
✔ï¸
​ConvInteger​
✔ï¸
​ConvTranspose​
✔ï¸
​Cos​
✔ï¸
​Cosh​
✔ï¸
​CumSum​
✔ï¸
​DepthToSpace​
​
​DequantizeLinear​
​
​Det​
​
​Div​
✔ï¸
​Dropout​
✔ï¸
​Einsum​
​
​Elu​
✔ï¸
​Equal​
✔ï¸
​Erf​
✔ï¸
​Exp​
✔ï¸
​Expand​
✔ï¸
​EyeLike​
✔ï¸
​Flatten​
✔ï¸
​Floor​
✔ï¸
​GRU​
​
​Gather​
✔ï¸
​GatherElements​
​
​GatherND​
✔ï¸
​Gemm​
✔ï¸
​GlobalAveragePool​
✔ï¸
​GlobalLpPool​
​
​GlobalMaxPool​
​
​Greater​
✔ï¸
​HardSigmoid​
✔ï¸
​Hardmax​
✔ï¸
​Identity​
✔ï¸
​If​
✔ï¸
​InstanceNormalization​
✔ï¸
​IsInf​
✔ï¸
​IsNaN​
✔ï¸
​LRN​
✔ï¸
​LSTM​
✔ï¸
​LeakyRelu​
✔ï¸
​Less​
✔ï¸
​Log​
✔ï¸
​Loop​
​
​LpNormalization​
​
​LpPool​
​
​MatMul​
✔ï¸
​MatMulInteger​
✔ï¸
​Max​
✔ï¸
​MaxPool​
✔ï¸
​MaxRoiPool​
​
​MaxUnpool​
​
​Mean​
✔ï¸
​Min​
✔ï¸
​Mod​
✔ï¸
​Mul​
✔ï¸
​Multinomial​
​
​Neg​
✔ï¸
​NonMaxSuppression​
✔ï¸
​NonZero​
✔ï¸
​Not​
✔ï¸
​OneHot​
​
​Or​
✔ï¸
​PRelu​
✔ï¸
​Pad​
✔ï¸
​Pow​
✔ï¸
​QLinearConv​
​
​QLinearMatMul​
​
​QuantizeLinear​
✔ï¸
​RNN​
​
​RandomNormal​
​
​RandomNormalLike​
​
​RandomUniform​
​
​RandomUniformLike​
​
​Reciprocal​
✔ï¸
​ReduceL1​
✔ï¸
​ReduceL2​
✔ï¸
​ReduceLogSum​
✔ï¸
​ReduceLogSumExp​
✔ï¸
​ReduceMax​
✔ï¸
​ReduceMean​
✔ï¸
​ReduceMin​
✔ï¸
​ReduceProd​
✔ï¸
​ReduceSum​
✔ï¸
​ReduceSumSquare​
✔ï¸
​Relu​
✔ï¸
​Reshape​
✔ï¸
​Resize​
✔ï¸
​ReverseSequence​
​
​RoiAlign​
​
​Round​
✔ï¸
​Scan​
​
Scatter
✔ï¸
​ScatterElements​
✔ï¸
​ScatterND​
✔ï¸
​Selu​
✔ï¸
​SequenceAt​
​
​SequenceConstruct​
​
​SequenceEmpty​
​
​SequenceErase​
​
​SequenceInsert​
​
​SequenceLength​
​
​Shape​
✔ï¸
​Shrink​
✔ï¸
​Sigmoid​
✔ï¸
​Sign​
✔ï¸
​Sin​
✔ï¸
​Sinh​
✔ï¸
​Size​
✔ï¸
​Slice​
✔ï¸
​Softplus​
✔ï¸
​Softsign​
✔ï¸
​SpaceToDepth​
​
​Split​
✔ï¸
​SplitToSequence​
​
​Sqrt​
✔ï¸
​Squeeze​
✔ï¸
​StringNormalizer​
​
​Sub​
✔ï¸
​Sum​
✔ï¸
​Tan​
✔ï¸
​Tanh​
✔ï¸
​TfIdfVectorizer​
​
​ThresholdedRelu​
✔ï¸
​Tile​
​
​TopK​
✔ï¸
​Transpose​
✔ï¸
​Unique​
​
​Unsqueeze​
✔ï¸
​Where​
✔ï¸
​Xor​
✔ï¸
​Celu​
✔ï¸
​DynamicQuantizeLinear​
✔ï¸
​GreaterOrEqual​
✔ï¸
​LessOrEqual​
✔ï¸
​LogSoftmax​
✔ï¸
​
​
​Range​
✔ï¸
​Softmax​
✔ï¸
​SoftmaxCrossEntropyLoss​
​

ai.onnx.ml

Operator
Opset 1 implementation
​
​ai.onnx.ml.Binarizer​
​
​ai.onnx.ml.CastMap​
​
​
​
✔ï¸
​ai.onnx.ml.Imputer​
​
​ai.onnx.ml.LabelEncoder​
​
​
âœ”ï¸ (partial)
​ai.onnx.ml.Normalizer​
​
​ai.onnx.ml.OneHotEncoder​
​
​ai.onnx.ml.SVMClassifier​
​
​ai.onnx.ml.SVMRegressor​
​
​ai.onnx.ml.Scaler​
✔ï¸
​
​
​ai.onnx.ml.ZipMap​
​