Prepare Floating-point Model

Before you read this section, we recommend that you read Toolchain Operator Support Constraint List section for an understanding of the operators and constraints supported by Horizon Robotics. Or, after you export your ONNX model, you can first refer to the Check the Model section to check that the model can be deployed with Horizon support for normal conversion.

A floating-point model trained on an open source DL framework is the input to the conversion tool, which currently supports the following DL frameworks:

FRAMEWORKHORIZON'S TOOLCHAIN
CaffeSupported
PyTorchSupported (convert into ONNX)
TensorFlowSupported (convert into ONNX)
TensorFlow LiteSupported (convert into ONNX)
PaddlePaddleSupported (convert into ONNX)
OthersContact Horizon

As shown above, the caffemodel exported from Caffe framework can be supported directly, While the models trained from the rest frameworks must be first converted into ONNX before using the conversion tool. Presently Horizon supports ONNX opset10-19.

  • For the Caffe model, you can first evaluate the floating-point model accuracy, confirm the correct model weights and structure.

  • For the ONNX model, you need to preform the model inference using HBRuntime to verify the inference results are consistent between ONNX and the original DL framework model(i.e., make sure the model is legal).

There are standard solutions to convert models of different frameworks into ONNX, refer to the following:

Attention

Original model limitations: ir_version≤9, 10≤opset=≤19, for the correspondence between ir_version and onnx version, please refer to onnx official documentation.