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.

TDA4VM: Creating Model Artefacts for a Custom Model

Part Number: TDA4VM

Could you point use to the standalone command/instructions on how to create model artefacts in order to run inference using TIDL RT as per https://github.com/TexasInstruments/edgeai-tidl-tools/tree/master/examples/tidlrt_cpp .

Note we can create model artefacts using 

edgeai-tidl-tools/examples/osrt_python/tfl# python3 tflrt_delegate.py -c

We are after just the model compilation step.

The link inhttps://github.com/TexasInstruments/edgeai-tidl-tools/tree/master/examples/tidlrt_cpp#setup seems to be broken.

Thanks

  • Hi Isharaka,

    This is a bug in the documentation. Thank you for the catch!

    The link should be linked to here: https://github.com/TexasInstruments/edgeai-tidl-tools#setup. Please follow those steps to set up the environment.

    Regards,

    Takuma

  • Thanks for that. That page still used this for

    edgeai-tidl-tools/examples/osrt_python/tfl# python3 tflrt_delegate.py -c

    model compilations.

    1. As far as I can see this script has a set of pre-configured models  (i.e. mlperf_models_configs in examples/osrt_python/tfl/utils.py ) that it can compile. We would like to know how to create model artefacts for a custom  model.

    2.  What parameters in addition to the model do we need to provide the model compilation process ? How do we determine these parameters?

    3. Is it correct to, say we must use tensorflow and a special delegate (tidl_model_import_tflite.so) to create model artefacts even if we do not plan to use tensorflow for inference (i.e. directly using TIDL RT)

  • Hello Isharaka,

    1. In our Model Zoo, we provide documentation for how we converted models to tflite format: github.com/.../mlperf_models.md

    These converted models are then used by the edgeai-tidl-tools python script to create the model artifacts

    2. The required and optional parameters are listed here so please reference this: https://github.com/TexasInstruments/edgeai-tidl-tools/tree/master/examples/osrt_python#user-options-for-tflite-and-onnx-runtime

    3. If you are planning to not use open source runtimes and instead wanting to use standalone TIDL RT, then please refer to https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/latest/exports/docs/tidl_j7_08_01_00_05/ti_dl/docs/user_guide_html/md_tidl_model_import.html

    Regards,

    Takuma

  • Hello Takuma,

    I attempted to convert mobilenet using the info from the link you provided with the following outcome. I was executing this on an Ubuntu 16.04 system. Could you advice on what could have been the problem?

    ti-processor-sdk-rtos-j721e-evm-08_00_01_10/tidl_j7_08_00_01_07/ti_dl/utils/tidlModelImport/out $ ./tidl_model_import.out tidl_import_mobileNetv1.txt 
    TFLite Model (Flatbuf) File  : ../../../test/testvecs/models/public/tflite/mobilenet_v1_1.0_224.tflite  
    TIDL Network File      : tidl_net_tflite_mobilenet_v1_1.0_224.bin  
    TIDL IO Info File      : tidl_io_tflite_mobilenet_v1_1.0_224_  
    31
     TFlite operator SQUEEZE is not suported now..  By passing
    tidl_model_import.out: tidl_import_common.cpp:176: void* my_malloc(int): Assertion `ptr != NULL' failed.
    Aborted (core dumped)

    This is the config I used.

    modelType          = 3
    numParamBits      = 12
    quantizationStyle  = 2
    inputNetFile      = ../../../test/testvecs/models/public/tflite/mobilenet_v1_1.0_224.tflite
    outputNetFile      = "tidl_net_tflite_mobilenet_v1_1.0_224.bin"
    outputParamsFile   = "tidl_io_tflite_mobilenet_v1_1.0_224_"
    inDataNorm  = 1
    inMean = 128 128 128
    inScale =  0.0078125 0.0078125 0.0078125
    resizeWidth = 256
    resizeHeight = 256
    inWidth  = 224
    inHeight = 224
    inNumChannels = 3
    inData = ../../../test/testvecs/config/imageNet_sample_val_bg.txt
    postProcType = 1