• Lv0
    粉丝1

积分19 / 贡献0

提问2答案被采纳0文章0

作者动态

参考demo接入Tensorflow Lite库时编译nnrt_delegate.so报错

xuemingdg 显示全部楼层 发表于 2023-10-25 10:39:46

参考官方demo链接接入TFLite标签分类模型时,在执行到第三步编译北向demo时报以下错误:

[ 25%] Linking CXX shared library ../../../../lib/libnnrt_delegate.so
ld.lld: error: undefined symbol: tflite::tools::ToolParams::AssertParamExists(std::__n1::basic_string<char, std::__n1::char_traits<char>, std::__n1::allocator<char> > const&) const

> > > referenced by nnrt_delegate_provider.cpp
> > > CMakeFiles/nnrt_delegate.dir/nnrt_delegate_provider.cpp.o:(tflite::tools::NnrtDelegateProvider::LogParams(tflite::tools::ToolParams const&, bool) const)
> > > referenced by nnrt_delegate_provider.cpp
> > > CMakeFiles/nnrt_delegate.dir/nnrt_delegate_provider.cpp.o:(tflite::tools::NnrtDelegateProvider::LogParams(tflite::tools::ToolParams const&, bool) const)
> > > referenced by nnrt_delegate_provider.cpp
> > > CMakeFiles/nnrt_delegate.dir/nnrt_delegate_provider.cpp.o:(tflite::tools::NnrtDelegateProvider::LogParams(tflite::tools::ToolParams const&, bool) const)
> > > referenced 32 more times

ld.lld: error: undefined symbol: tflite::tools::ToolParam::ParamType tflite::tools::ToolParam::GetValueType<bool>()

> > > referenced by nnrt_delegate_provider.cpp
> > > CMakeFiles/nnrt_delegate.dir/nnrt_delegate_provider.cpp.o:(tflite::tools::NnrtDelegateProvider::LogParams(tflite::tools::ToolParams const&, bool) const)
> > > referenced by nnrt_delegate_provider.cpp
> > > CMakeFiles/nnrt_delegate.dir/nnrt_delegate_provider.cpp.o:(tflite::tools::NnrtDelegateProvider::LogParams(tflite::tools::ToolParams const&, bool) const)
> > > referenced by nnrt_delegate_provider.cpp
> > > CMakeFiles/nnrt_delegate.dir/nnrt_delegate_provider.cpp.o:(tflite::tools::NnrtDelegateProvider::LogParams(tflite::tools::ToolParams const&, bool) const)
> > > referenced 17 more times

ld.lld: error: undefined symbol: tflite::tools::ToolParam::AssertHasSameType(tflite::tools::ToolParam::ParamType, tflite::tools::ToolParam::ParamType)

> > > referenced by nnrt_delegate_provider.cpp
> > > CMakeFiles/nnrt_delegate.dir/nnrt_delegate_provider.cpp.o:(tflite::tools::NnrtDelegateProv

检查了deep_learning_framework/lib_3rd_nnrt_tflite/include/tensorflow/lite/下是包含了tflite的头文件的,deep_learning_framework/lib_3rd_nnrt_tflite/com/arm64-v8a/lib/包含了编译好的libtensorflow-lite.so,但是在cmake_build目录下执行make就会报以上错误,我是不是依赖做少了什么?

您尚未登录,无法参与评论,登录后可以:
参与开源共建问题交流
认同或收藏高质量问答
获取积分成为开源共建先驱

精彩评论5

xuemingdg

沙发 发表于 2023-10-26 16:26:48

发现之前tflite的so是用GCC编译的,标准库函数签名和OHOS用的clang编译出来的不一样,现在打算用OHOS的clang编译tflite却发现XNNPACK和cpuinfo会报不支持OHOS的错误,这一步不知道该怎么做了

xxx1004x

发表于 2024-8-12 15:11  IP属地: 北京市

回复 xuemingdg: 你好,这个你后面解决了吗? 在鸿蒙编译链下,能出产物吗?希望大佬告知

【1 条回复】

xuemingdg

板凳 发表于 2023-10-27 11:19:25
更新一下进度,目前编译北向demo完成,但是推送至设备上运行报以下错误
/bin/sh: ./label_classify: No such file or directory
执行命令是./label_classify -m ./mobilenet_v2.tflite -i ./grace_hopper.bmp -l ./labels.txt -a 1 -z 1
目录下有的文件内容为 grace_hopper.bmp  libneural_network_runtime.z.so  mobilenet_v2.tflite  
label_classify    libnnrt_delegate.so
labels.txt        libnnrt_implementation.so,是否还缺少了什么依赖项呢

xuemingdg

地板 发表于 2023-10-27 14:42:04

执行了file label_classify显示

label_classify: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-aarch64.so.1, BuildID[sha1]=cc170e98796127db83a270cecbb7ab16fe6f1878, with debug_info, not stripped

发现hdc shell的/lib/下并没有ld-musl-aarch64.so.1这个文件而只有一个ld-musl-arm.so.1这样的文件,查看一下发现这是arm32位系统的,请问下接下来我应该如何做

补充一下目标设备是dayu200,系统目前安装了OpenHarmony3.2,查看了版本确实是aarch64架构的

论坛小助手 官方账号

5# 发表于 2023-11-7 09:13:23

刷一个64位的系统,或者编一个32位版本的可执行程序

共5 条回复,点击查看

Copyright   ©2023  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

返回顶部