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.

PROCESSOR-SDK-J722S: Issue about convert onnx file to TIDL format

Part Number: PROCESSOR-SDK-J722S

Tool/software:

Hi team,

I am trying to run inference on a custom model following the steps below but encountered an issue:

  1. Flow: ONNX file --> convert to TIDL format --> run inference

    • I can successfully run inference using models from the Model Zoo.
    • However, when I use edgeai-tidl-tools/tidl_tools/tidl_model_import.out to convert my ONNX model to TIDL format and then attempt to run inference, I encounter an error stating that param.yaml does not exist.

My convert model (on the left) differs from the example model in the Model Zoo (on the right).

Questions:

  1. Is it possible to generate config.yaml, dataset.yaml, and param.yaml using tidl_model_import.out? If so, how can I configure them correctly?

  2. Could you please provide an example of converting an ONNX file to TIDL format and running inference?

  3. I also attempted the Custom Model Evaluation method.(github.com/.../custom_model_evaluation.md(github.com/.../custom_model_evaluation.md

    • However, the log shows the error: EP Error Unknown Provider Type: TIDLCompilationProvider when using ['TIDLCompilationProvider', 'CPUExecutionProvider'].
    • Am I missing any settings? My code is below:

import torch
import onnx
import onnxruntime as rt
import subprocess
import os

# 定義參數
onnx_model_path = "model.onnx"
simplified_onnx_model_path = "model_simplified.onnx"
tidl_artifacts_folder = "./model-artifacts-dir/"
tidl_tools_path = "./app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/tidl_tools/"

# Step 1: 導出 ONNX 模型 (以 PyTorch 為例)
def export_pytorch_model_to_onnx(model, input_shape):
    dummy_input = torch.randn(*input_shape)
    torch.onnx.export(model, dummy_input, onnx_model_path, opset_version=11)
    print(f"ONNX model exported to {onnx_model_path}")

# Step 2: 檢查模型有效性並推斷形狀
def check_and_infer_shape(onnx_model_path):
    model = onnx.load(onnx_model_path)
    inferred_model = onnx.shape_inference.infer_shapes(model)
    onnx.save(inferred_model, "inferred_model.onnx")
    print("Shape inference complete and saved to inferred_model.onnx")

# Step 3: 簡化 ONNX 模型
def simplify_onnx_model(onnx_model_path, simplified_model_path):
    subprocess.run(["python3", "-m", "onnxsim", onnx_model_path, simplified_model_path])
    print(f"Simplified ONNX model saved to {simplified_model_path}")

# Step 4: 設定 ONNX Runtime TIDL 編譯會話
def setup_tidl_session(simplified_model_path):
    # 設置編譯參數
    options = {
        "artifacts_folder": tidl_artifacts_folder,
        "tidl_tools_path": tidl_tools_path
    }
    so = rt.SessionOptions()
    ep_list = ['TIDLCompilationProvider', 'CPUExecutionProvider']
    
    # 設置編譯會話,使用 TIDLCompilationProvider 進行編譯
    sess = rt.InferenceSession(simplified_model_path, providers=ep_list, provider_options=[options, {}], sess_options=so)
    
    print("TIDL model compilation session created.")
    return sess

# Step 5: 驗證模型的輸出
def validate_model_output(sess, input_data):
    # 確保 TIDL 編譯模型可以產生正確輸出
    input_name = sess.get_inputs()[0].name
    output_name = sess.get_outputs()[0].name
    
    output = sess.run([output_name], {input_name: input_data})
    print(f"Model output: {output}")

# 主流程
if __name__ == "__main__":
    # 假設這是 PyTorch 模型和輸入維度
    model = torch.nn.Sequential(
        torch.nn.Conv2d(3, 16, 3, stride=2, padding=1),
        torch.nn.ReLU(),
        torch.nn.Flatten(),
        torch.nn.Linear(16 * 112 * 112, 10)
    )
    input_shape = (1, 3, 224, 224)

    # 導出、檢查、簡化、編譯和驗證模型
    export_pytorch_model_to_onnx(model, input_shape)
    check_and_infer_shape(onnx_model_path)
    simplify_onnx_model(onnx_model_path, simplified_onnx_model_path)
    session = setup_tidl_session(simplified_onnx_model_path)
    
    # 使用隨機數據進行驗證
    input_data = torch.randn(*input_shape).numpy()
    validate_model_output(session, input_data)
    print("Available providers:", rt.get_available_providers())

Thanks for your kindly help.

  • Hi Ken; we will look into this. First we will do exact what you have done, to find out if we will have the same problem. Could you please provide the software version#; the command for each step, and your Linux environment? So we can replicate them on our side.

    Thanks and regards

    Wen Li

  • My TIDL version is 10.00.04.00, and Ubuntu version is 22.04

    My setup TIDL sop below:

    apt-get update
    apt-get upgrade
    apt install sudo
    sudo apt-get install libyaml-cpp-dev libglib2.0-dev
    apt install git
    apt install wget
    Pip3 install dlr
    pip3 install flatbuffers==2.0
    Sudo apt install cmake
    sudo apt install libopencv-dev
    
    
    git clone https://github.com/TexasInstruments/edgeai-tidl-tools.git
    cd edgeai-tidl-tools/
    git checkout 110634e30a121b6efdfba8faf75c347e21caa49e
    export SOC=am67a
    source ./setup.sh
    
    export SOC=<Your SOC name>
    export TIDL_TOOLS_PATH=$(pwd)/tidl_tools
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TIDL_TOOLS_PATH
    export ARM64_GCC_PATH=$(pwd)/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu
    mkdir build && cd build
    cmake ../examples && make -j && cd ..
    

    I try two way to convert onnx to TIDL format:

    [1]

    - cd <local path>/tidl_tools

    - ./tidl_model_import.out ../ken_test_model/test.txt

    - test.txt :

    #### lenet
    
    modelType          = 2
    numParamBits       = 8
    numFeatureBits     = 8
    quantizationStyle  = 3
    #quantizationStyle  = 2
    inputNetFile       = "/app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/ken_test_model/lenet.onnx"
     
    outputNetFile      = "/app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/ken_test_model/lenet_res/lenet.bin"
    outputParamsFile   = "/app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/ken_test_model/lenet_res/lenet_"
    inDataNorm  = 0
    inDataFormat = 1
    inWidth  = 28
    inHeight = 28 
    inNumChannels = 1
    numFrames = 1
    inData  =   "/app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/ken_test_model/0003.jpg"
    # 0 = JPEG/PNG/BMP; 1 = binary; 2 = list
    inFileFormat = 0
    perfSimConfig = /app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/tidl_tools/device_config.cfg
    inElementType = 0
    metaArchType = 4
    postProcType = 3

    - log below: (but can't fnd param.yaml / dataset.yaml, can't run inference)

    root@914dec19bac9:/app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/tidl_tools# ./tidl_model_import.out ../ken_test_model/test.txt
    ========================= [Model Compilation Started] =========================
    
    Model compilation will perform the following stages:
    1. Parsing
    2. Graph Optimization
    3. Quantization & Calibration
    4. Memory Planning
    
    ============================== [Version Summary] ==============================
    
    -------------------------------------------------------------------------------
    |          TIDL Tools Version          |              10_00_04_00             |
    -------------------------------------------------------------------------------
    |         C7x Firmware Version         |              10_00_02_00             |
    -------------------------------------------------------------------------------
    
    No Meta Arch layer to parse
    ONNX model (Proto) file      : /app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/ken_test_model/lenet.onnx  
    TIDL network file            : /app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/ken_test_model/lenet_res/lenet.bin  
    TIDL IO info file            : /app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/ken_test_model/lenet_res/lenet_  
    Current ONNX OpSet version   : 9  
    ============================ [Optimization started] ============================
    
    ----------------------------- Optimization Summary -----------------------------
    ---------------------------------------------------------------------------------
    |          Layer         | Nodes before optimization | Nodes after optimization |
    ---------------------------------------------------------------------------------
    | TIDL_CropLayer         |                         0 |                        2 |
    | TIDL_ConvolutionLayer  |                         2 |                        2 |
    | TIDL_ReLULayer         |                         1 |                        0 |
    | TIDL_InnerProductLayer |                         2 |                        2 |
    | TIDL_SoftMaxLayer      |                         1 |                        1 |
    | TIDL_PoolingLayer      |                         2 |                        2 |
    ---------------------------------------------------------------------------------
    
    =========================== [Optimization completed] ===========================
    
    Couldn't open tidlStatsTool file: ../../test/PC_dsp_test_dl_algo.out
    ------------------ Fixed-point Calibration Iteration [1 / 1]: ------------------
    Couldn't open tidlStatsTool file: ../../test/PC_dsp_test_dl_algo.out
    ==================== [Quantization & Calibration Completed] ====================
    
    [TIDL Import]  WARNING: Couldn't open perfSimTool file: ../../utils/perfsim/ti_cnnperfsim.out. Skipping Performance Simulation.
    Rerunning network compiler...
    [TIDL Import]  WARNING: Couldn't open perfSimTool file: ../../utils/perfsim/ti_cnnperfsim.out. Skipping Performance Simulation.
    [TIDL Import]  WARNING: Couldn't open graphVizTool file: ../../utils/tidlModelGraphviz/out/tidl_graphVisualiser.out . Skipping Graph Visualization.
    [TIDL Import]  WARNING: Couldn't open graphVizTool file: ../../utils/tidlModelGraphviz/out/tidl_graphVisualiser.out . Skipping Graph Visualization.
    [TIDL Import] [PARSER] WARNING: 
    ********************************************************************
    *     Network compiler returned with error or didn't executed      *
    *      This model can only be used on PC/Host emulation mode       *
    *            It is not expected to work on target/EVM              *
    ********************************************************************
    
    ======================== Subgraph Compiled Successfully ========================
    

    [2]

    - cd <local path>/examples/jupyter_notebooks

    - source ./launch_notebook.sh

    - python3 tidl_model_convert_onnx.py

    - tidl_model_convert_onnx.py below:

    import os
    import tqdm
    import cv2
    import numpy as np
    import onnxruntime as rt
    import shutil
    from scripts.utils import imagenet_class_to_name, download_model
    import matplotlib.pyplot as plt
    from pathlib import Path
    from IPython.display import Markdown as md
    from scripts.utils import loggerWritter
    from scripts.utils import get_svg_path
    import onnx
    
    def preprocess(image_path):
        
        # read the image using openCV
        img = cv2.imread(image_path)
        
        # convert to RGB
        img = img[:,:,::-1]
        
        # Most of the onnx models are trained using
        # 224x224 images. The general rule of thumb
        # is to scale the input image while preserving
        # the original aspect ratio so that the
        # short edge is 256 pixels, and then
        # center-crop the scaled image to 224x224
        orig_height, orig_width, _ = img.shape
        short_edge = min(img.shape[:2])
        new_height = (orig_height * 256) // short_edge
        new_width = (orig_width * 256) // short_edge
        img = cv2.resize(img, (new_width, new_height), interpolation=cv2.INTER_CUBIC)
    
        startx = new_width//2 - (224//2)
        starty = new_height//2 - (224//2)
        img = img[starty:starty+224,startx:startx+224]
        
        # apply scaling and mean subtraction.
        # if your model is built with an input
        # normalization layer, then you might
        # need to skip this
        img = img.astype('float32')
        for mean, scale, ch in zip([128, 128, 128], [0.0078125, 0.0078125, 0.0078125], range(img.shape[2])):
                img[:,:,ch] = ((img.astype('float32')[:,:,ch] - mean) * scale)
        img = np.expand_dims(img,axis=0)
        img = np.transpose(img, (0, 3, 1, 2))
        
        return img
    calib_images = [
    'sample-images/elephant.bmp',
    'sample-images/bus.bmp',
    'sample-images/bicycle.bmp',
    'sample-images/zebra.bmp',
    ]
    output_dir = 'custom-artifacts/onnx/resnet18_opset9.onnx'
    onnx_model_path = 'models/public/onnx/resnet18_opset9.onnx'
    download_model(onnx_model_path)
    onnx.shape_inference.infer_shapes_path(onnx_model_path, onnx_model_path)
    #compilation options - knobs to tweak 
    num_bits =8
    accuracy =1
    
    log_dir = Path("logs").mkdir(parents=True, exist_ok=True)
    
    # stdout and stderr saved to a *.log file.  
    #with loggerWritter("logs/custon-model-onnx"):
    
    # model compilation options
    compile_options = {
        'tidl_tools_path' : os.environ['TIDL_TOOLS_PATH'],
        'artifacts_folder' : output_dir,
        'tensor_bits' : num_bits,
        'accuracy_level' : accuracy,
        'advanced_options:calibration_frames' : len(calib_images), 
        'advanced_options:calibration_iterations' : 3, # used if accuracy_level = 1
        'advanced_options:add_data_convert_ops' : 1,
        'debug_level' : 1,
        #'deny_list' : "MaxPool" #Comma separated string of operator types as defined by ONNX runtime, ex "MaxPool, Concat"
    }
    # create the output dir if not present
    # clear the directory
    os.makedirs(output_dir, exist_ok=True)
    for root, dirs, files in os.walk(output_dir, topdown=False):
        [os.remove(os.path.join(root, f)) for f in files]
        [os.rmdir(os.path.join(root, d)) for d in dirs]
    
    so = rt.SessionOptions()
    EP_list = ['TIDLCompilationProvider','CPUExecutionProvider']
    sess = rt.InferenceSession(onnx_model_path ,providers=EP_list, provider_options=[compile_options, {}], sess_options=so)
    
    input_details = sess.get_inputs()
    for num in tqdm.trange(len(calib_images)):
        output = list(sess.run(None, {input_details[0].name : preprocess(calib_images[num])}))[0]
    
    ##optional
    #subgraph_link =get_svg_path(output_dir) 
    #for sg in subgraph_link:
    #    hl_text = os.path.join(*Path(sg).parts[4:])
    #    sg_rel = os.path.join('../', sg)
    #    display(md("[{}]({})".format(hl_text,sg_rel)))
    #
    #EP_list = ['TIDLExecutionProvider','CPUExecutionProvider']
    #print("[ken debug] 5 ")
    #sess = rt.InferenceSession(onnx_model_path ,providers=EP_list, provider_options=[compile_options, {}], sess_options=so)
    ##Running inference several times to get an stable performance output
    #for i in range(5):
    #    output = list(sess.run(None, {input_details[0].name : preprocess('sample-images/elephant.bmp')}))
    #
    #for idx, cls in enumerate(output[0].squeeze().argsort()[-5:][::-1]):
    #    print('[%d] %s' % (idx, '/'.join(imagenet_class_to_name(cls))))
    #    
    #from scripts.utils import plot_TI_performance_data, plot_TI_DDRBW_data, get_benchmark_output
    #stats = sess.get_TI_benchmark_data()
    #fig, ax = plt.subplots(nrows=1, ncols=1, figsize=(10,5))
    #plot_TI_performance_data(stats, axis=ax)
    #plt.show()
    #print("[ken debug] 6 ")
    #tt, st, rb, wb = get_benchmark_output(stats)
    #print(f'Statistics : \n Inferences Per Second   : {1000.0/tt :7.2f} fps')
    #print(f' Inference Time Per Image : {tt :7.2f} ms  \n DDR BW Per Image        : {rb+ wb : 7.2f} MB')

    - log below (If this successfully, will convert param.yaml and dataset.yaml?, inference code need these two files):

    root@914dec19bac9:/app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/examples/jupyter_notebooks# ls
    README.md  custom-artifacts         custom-model-tvm-dlr.ipynb  evm-console-log.ipynb             lidar-3dod-onnx.ipynb  prebuilt-models  tidl_model_convert_onnx.py    vcls-hr.ipynb        vcls-tfl-arm.ipynb  vdet-onnx.ipynb  vseg-onnx.ipynb
    colab      custom-model-onnx.ipynb  debug_tips.ipynb            human-pose-estimation-onnx.ipynb  logs                   sample-images    tidl_model_convert_tflite.py  vcls-onnx-arm.ipynb  vcls-tfl.ipynb      vdet-tfl.ipynb   vseg-tfl.ipynb
    configs    custom-model-tfl.ipynb   docs                        launch_notebook.sh                models                 scripts          vcls-dlr.ipynb                vcls-onnx.ipynb      vdet-dlr.ipynb      vseg-dlr.ipynb
    root@914dec19bac9:/app/ken/tda4/TIDL10.00.06.00/edgeai-tidl-tools/examples/jupyter_notebooks# python3 tidl_model_convert_onnx.py
    /usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py:115: UserWarning: Specified provider 'TIDLCompilationProvider' is not in available provider names.Available providers: 'AzureExecutionProvider, CPUExecutionProvider'
      warnings.warn(
    2024-11-08 01:54:33.885035952 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer4.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885066086 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer4.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885073018 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer3.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885080827 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer4.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885086808 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer3.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885092786 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer3.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885099389 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer2.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885105336 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer3.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885110886 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer1.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885117031 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer1.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885123454 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885130440 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer1.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885137239 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer2.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885143287 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer1.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885149198 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer4.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885155127 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer4.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885161162 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer2.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885167884 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer3.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885173780 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer2.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.885180693 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer2.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    *************** EP Error ***************
    EP Error Unknown Provider Type: TIDLCompilationProvider when using ['TIDLCompilationProvider', 'CPUExecutionProvider']
    Falling back to ['CPUExecutionProvider'] and retrying.
    ****************************************
    2024-11-08 01:54:33.927323820 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer4.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927345830 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer4.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927350568 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer3.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927354911 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer4.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927359205 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer3.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927364325 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer3.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927371761 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer2.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927375518 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer3.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927379046 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer1.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927383303 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer1.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927388536 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927392920 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer1.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927397340 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer2.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927401788 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer1.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927406226 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer4.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927409846 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer4.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927413522 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer2.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927418452 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer3.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927423215 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer2.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    2024-11-08 01:54:33.927427769 [W:onnxruntime:, graph.cc:4285 CleanUnusedInitializersAndNodeArgs] Removing initializer 'layer2.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
    100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 104.86it/s]

    Please help me to check,

    Thanks for your kindly help.

  • Hello Ken; Thank you for the information. I will try to setup the same configuration/environment as you have; and will up you updated.

    Regards

    Wen Li

  • Hi Wen,

    Thank you very much for your attention, and I look forward to receiving your reply.

    Best regards

  • Hi Ken; I am still working on your one. 

    Meanwhile, have you look at this info yet?

    https://github.com/TexasInstruments/edgeai-tidl-tools/blob/master/docs/custom_model_evaluation.md#custom-model-evaluation

    Thanks and regards

    Wen

  • Hi Wen:

    I have followed the instructions from this link and implemented the process:
    https://github.com/TexasInstruments/edgeai-tidl-tools/blob/master/examples/jupyter_notebooks/custom-model-onnx.ipynb,

    but I encountered the error "EP Error Unknown Provider Type: TIDLCompilationProvider."

    (https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1435070/processor-sdk-j722s-run-onnx-compilation-fail/5503642.)

    Thanks for your kindly help.

    Best regards

  • Hi Ken;

    I will run this 

    https://github.com/TexasInstruments/edgeai-tidl-tools/blob/master/examples/jupyter_notebooks/custom-model-onnx.ipynb

    Jupyter book first to see if I will get the same result. if not we will compare our notes.

    Thanks and regards

    Wen

  • Hi Wen:

    Sorry to bother you, do you get the same result after running the above steps?

    Thanks for your kindly help.