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:Mediapipe TFLITE CNN 无法通过 TIDL 工具导入:Crash SIGSEGV

Guru**** 2539500 points
Other Parts Discussed in Thread: TDA4VM

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1188879/tda4vm-mediapipe-tflite-cnn-cannot-be-imported-by-tidl-tools-crash-sigsegv

器件型号:TDA4VM

你好

尝试使用 TIDL 工具导入 CNN 神经网络模型时遇到问题。

我使用的 CNN 是 Google Mediapipe  face_detection_short_range.tflite  ,可在  https://google.github.io/mediapipe/solutions/models.html 上找到 

我有 TDA4VM 板、并在 Ubuntu 18.04下使用以下 RTOS SDK  

https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-bA0wfI4X2g/08.05.00.11/ti-processor-sdk-rtos-j721e-evm-08_05_00_11.tar.gz

这是尝试导入 CNN 时获得的 GDB 反向跟踪

#0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:257
#1  0x00007fffc65d5f04 in tflite::tfl_delegate::TIDL_tfliteRtCopyInputConstTensor (registration=0x1032620, node=0x10325d0, context=0xf1f198, inIdx=1,
    buf=..., scaleBuf=..., zpBuf=...) at tidl_tfLiteRtImport_core.cpp:344
#2  0x00007fffc65d72aa in tflite::tfl_delegate::TIDL_tfliteRtMapConvParams (registration=0x1032620, node=0x10325d0, context=0xf1f198, layer=...)
    at tidl_tfLiteRtImport_core.cpp:661
#3  0x00007fffc65db2cd in tflite::tfl_delegate::TIDL_tfliteRtMapNode (registration=0x1032620, node=0x10325d0, context=0xf1f198, layer=...,
    odUserParams=0x1032480) at tidl_tfLiteRtImport_core.cpp:1644
#4  0x00007fffc65dcf34 in tflite::tfl_delegate::TIDL_tfliteAllowlistNode (registration=0x1032620, node=0x10325d0, node_index=2, context=0xf1f198,
    isObjectDetectionNetwork=true, osrtDebugPrintLevel=1, denyList=0x0, denyListSize=0, denyList_layer_type=std::vector of length 0, capacity 0,
    denyList_layer_name=std::vector of length 0, capacity 0, odProcNodesComplement=std::vector of length 0, capacity 0, hasDetectionPostprocLayer=false,
    odUserParams=0x1032480) at tidl_tfLiteRtImport_core.cpp:2076

我们可以看到 、TFLITE 委派  tidl_model_import_tflite.so 在文件  tidl_tfLiteRtImport_core.cpp 行344中崩溃

我在 tidl_tfLiteRtImport_core  代码中添加了一些 printf,并发现指针  "ptr" 为 NULL,因此在下一个 memcpy 中将 SIGSEGV 添加到了。

Auto * ptr =重新解释<float *> (input->data.raw);
我使用一个小型 python 脚本导入 CNN 模型,下面是一个提取
tidl_delegate = [tflite.load_delegate(os.path.join(tidl_tools_path, 'tidl_model_import_tflite.so'), compile_options)]
interpreter = tflite.Interpreter(model_path=tflite_model_path, experimental_delegates=tidl_delegate)
以及在线导入崩溃   
解释器= tflite.Interpreter (model_path=tflite_model_path实验性_Delegations=tidl_Delegate)
无论我使用哪个 compile_options、崩溃都是相同的。
我想知道 TIDL 是否不支持该 CNN?
当显示在 Netron 工具中时、它表现出对等量运算符的奇怪用法。
我精确地确定、即使我们在"deny"列表导入选项中添加了去磁化运算符、也会出现崩溃。
感谢你的帮助。