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.

[参考译文] TDA4VH-Q1:循环执行文件读取以进行 TIDL 推理时遇到异常,

Guru**** 2455360 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1483528/tda4vh-q1-encountered-exceptions-when-looping-through-file-reads-for-tidl-inference

器件型号:TDA4VH-Q1

工具与软件:

使用原始 SDK 进行测试循环遍历文件读取以进行推理时、我们遇到异常。

有时会打印类似于寄存器错误的异常、有时程序会冻结、而不提供任何反馈。

在大多数情况下、当读取数据->执行 TIDL 推理->保存数据的过程循环约3000次时、会发生异常。

但是、如果程序仅对单个映像执行循环读取测试、则正常工作。

我运行的演示为 TI_DEVICE_ARMv8_TEST_dl_algo_host_rt.out、在   c7x-mma-tidl/arm-tidl/RT 中编译

 

这是我的推测配置

/cfs-file/__key/communityserver-discussions-components-files/791/tidl_5F00_infer_5F00_east_5F00_single.txt

这是我的推断数据集

/cfs-file/__key/communityserver-discussions-components-files/791/test_5F00_east_5F00_single.txt

我修改了这部分源代码以支持读取每帧功能映射。此文件位于 c7x-mma-tidl/arm-tidl/rt/test/tidl/ src

/cfs-file/__key/communityserver-discussions-components-files/791/tidl_5F00_tb_5F00_utils.c

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我已将您的问题重定向到相关工程师。

    谢谢!

    Fabiana

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Guang:

    您是否在两次跑步之间打开和关闭 Ort::会话?  在这种情况下、可能会发生内存泄漏。

    此外、这是准确调试所需的内容。

    • 您使用的是哪个版本的 SDK/TIDL?
    • 这是在主机还是器件上?
    • test_east_single.txt 中.bin 文件的 zip 文件、我假设它们是输入、在文本中列出这些文件 只会告诉我缺少一些内容
    • 如何 在 PC 和器件上运行该程序(命令行调用)
    • tidl_tb_utils 中修改了什么?
    • "但是、如果程序仅对单个映像执行循环读取测试"的含义是什么?  您是否反复读取同一图像、或者您是否将图像副本保存到存储器中并重新运行它。  另外、请提供有关如何运行此操作的命令行。

    Chris

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    否、演示 TI_DEVICE_ARMv8_TEST_dl_algo_host_rt.out 不涉及 ort:sessions。

    • 我使用的 SDK 是   ti-processor-sdk-rtos-j784s4-evm-09_02_00_05.tar.gz  
    • 行为
    • 您可以使用 python 脚本来生成输入数据

                

    import os
    import numpy as np
    directory_path = "./data"
    if not os.path.exists(directory_path):
        os.makedirs(directory_path)
        print(f"Directory '{directory_path}' has been created.")
    else:
        print(f"Directory '{directory_path}' already exists.")
    featuremap_size = 3*512*512
    for line in open("./test_east_single.txt"): 
        t1 = np.random.randint(0,255,featuremap_size).astype(np.uint8)
        line = line.strip()
        t1.tofile(line)

    • 我运行 commad "./TI_DEVICE_ARMv8_TEST_dl_algo_host_rt.out"
    • 您可以将 tidl_tb_utils.c 与 ti-processor-sdk-rtos-j784s4-evm-09_02_00_05.tar.gz 中的原始文件进行比较。 修改后的代码支持根据 test_east_single.txt 逐行读取二进制文件。
    • 如果文件 test_east_single.txt 中的每一行都是相同的。 没关系;

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Guang:

    您是否可以捕获 IEER 和 IEAR 寄存器中的值?  在初始屏幕截图中、值可能已打印在屏幕截图中捕获的下方。  出于调试目的、日志输出可能优于屏幕捕获。   

    此致、

    Chris

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    e2e.ti.com/.../6318.Tmp.zip

    这是测试模型

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Guang:

    我曾尝试 在 SDK 9.2上的 EVM 上重现问题、但看不到您存在的问题:

    # NETWORK_EXECUTION_TIME =     0.91 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file ./data/00000063935527256.bin
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.89 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file ./data/00000548692561272.bin
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.89 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file ./data/011053.bin
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.89 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file ./data/00001346662392672.bin
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.89 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file ./data/00000138717023207.bin
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.89 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file ./data/00000521592019049.bin
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.89 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file ./data/00001189092925982.bin
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.88 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file ./data/00001189092925982.bin
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.89 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file p�
                                       ���
    featuremap open failed p�
                             ���
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.89 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file p�
                                       ���
    featuremap open failed p�
                             ���
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.89 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file p�
                                       ���
    featuremap open failed p�
                             ���
     Freeing memory for user provided Net
     ----------------------- TIDL Process with TARGET DATA FLOW ------------------------
    
    # NETWORK_EXECUTION_TIME =     0.88 (in ms, c7x @1GHz) with DDR_BANDWIDTH (Read + Write) =     0.00,     0.00,     0.00 (in Mega Bytes/frame) ... .... .....opening file p�
    

    测试代码无法读取更多输入、因为它已到达输入列表底部:

    ........
    ./data/0000032694881128.bin
    ./data/00000095986168515.bin
    ./data/413397.bin
    ./data/00000455051040242.bin
    ./data/0000037697380986.bin
    ./data/1561473.bin
    ./data/0000047811901727.bin
    ./data/2349480.bin
    ./data/20220212_190948_0000242.bin
    ./data/684389.bin
    ./data/0000022734689647.bin
    ./data/00000063935527256.bin
    ./data/00000548692561272.bin
    ./data/011053.bin
    ./data/00001346662392672.bin
    ./data/00000138717023207.bin
    ./data/00000521592019049.bin
    ./data/00001189092925982.bin

    此致、

    Adam

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    e2e.ti.com/.../Register_5F00_print.log

    这是所有寄存器打印日志

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Guang:

    您在使用什么 SDK? 为什么您的车型运行时间比 myside 长? 您能帮助确认 我们运行的是同一模型吗?

    ht@ht-OMEN:~/customer/hikauto/6318.Tmp$ md5sum tidl_net_onnx.bin 
    c7b34476e96b5a643b2db81be624e29c  tidl_net_onnx.bin
    ht@ht-OMEN:~/customer/hikauto/6318.Tmp$ md5sum tidl_io_onnx_1.bin 
    64e7e63f1f3c4bc7b7baa2138d0741b5  tidl_io_onnx_1.bin

    此致、

    Adam

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    出于保密原因、我们在外部提供模型时进行了模型修剪。
    这不会影响重现问题的能力。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Guang:

    我明白了。 但我无法在我这边重现您的问题。 您可以在 TI EVM 和默认 SDK 上重试吗?

    此致、

    Adam

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    此日志信息是否可以提供故障排除的指导?

    /cfs-file/__key/communityserver-discussions-components-files/791/Register_5F00_print.log