你好
尝试使用 TIDL 工具导入 CNN 神经网络模型时遇到问题。
我使用的 CNN 是 Google Mediapipe face_detection_short_range.tflite ,可在 https://google.github.io/mediapipe/solutions/models.html 上找到
我有 TDA4VM 板、并在 Ubuntu 18.04下使用以下 RTOS SDK
这是尝试导入 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 添加到了。
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)