This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] AM68A: How to leverage edgeai-tidl-tool's Advanced Examples for custom model compilation ?

Part Number: AM68A

I have custom model that i want to compile using edgeai-tidl-tools, with following details

1. The standard OSRT example scripts needs pre and post processing params, how can we bypass this and use randomly generated tensors as input.

2. How to deal with TIDL unsupported params ? 

  • Please follow below listed steps,

    Download the edgeai-tidl-tools from official github repos : (https://github.com/TexasInstruments/edgeai-tidl-tools).

    1.  Set up edgeai-tidl-tools

    2. Compile your model

    • You can find advance example code under below path  
      • ls examples/osrt_python/advanced_examples/unit_tests_validation/ort/onnxrt_ep.py

    • You have to modify onnxrt_ep.py. Please download the update python script (onnxrt_ep.py) for your model. You may need to change the path for your model (line# 118). Note that this script generates input tensor randomly.
      • python onnxrt_ep.py -d  # delegate all the layers to see if the onnx model is good
      • python onnxrt_ep.py -c  # Compile the model, based on tensor_bits 
      • python onnxrt_ep.py      # Run inference
        • You may come across error if "../outputs/output_ref/onnx" or "../outputs/output_test/onnx" doesn't exist. You have to make these directories
    • This script uses config params specified in examples/osrt_python/advanced_examples/unit_tests_validation/common_utils.py. You have to set
      • "advanced_options:add_data_convert_ops" : 3, (line #69)

    • And you may want to change the following params:
      • tensor_bits = 32  (line# 20 - 32 for floating, 16 and 8 for fixed point)
      • debug_level = 0 (line# 21 - 1~ 3 recommended)
    • If particular layers are not supported, you can put such layers in "deny_list" (line# 52) in common_utils.py. For example,
      • "deny_list:layer_name":"p2o.GlobalAveragePool.4,p2o.Conv.101,p2o.Conv.104",

    • Then you can find artifacts directory created in "artifacts_folder", which is specified in common_utils.py (line# 16)