gpt4 book ai didi

c++ - Tensorflow Lite arm64 错误 : cannot convert ‘const int8x8_t?

转载 作者:太空宇宙 更新时间:2023-11-04 02:22:12 24 4
gpt4 key购买 nike

我尝试在 ubuntu 16.04 上构建 AARCH64。我遵循了本指南(本地编译)https://tensorflow.google.cn/lite/guide/build_arm64 .

但是我得到了这个错误。什么是问题?我也想在 Orange Pi 3 上尝试示例。在为 arm64 构建后如何使用 libtensorflow-lite.a 文件。我知道 Qt ide 和 C&C++。谢谢。

In file included from ./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h:22:0,
from tensorflow/lite/kernels/depthwise_conv.cc:29:
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h: In static member function ‘static void tflite::optimized_ops::depthwise_conv::WorkspacePrefetchWrite<(tflite::DepthwiseConvImplementation)3>::Run(int8, int, int8*)’:
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:5782:71: note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts
vst1_lane_u32(reinterpret_cast<uint32_t*>(ptr), fill_data_vec, 0);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:5782:71: error: cannot convert ‘const int8x8_t {aka const __vector(8) signed char}’ to ‘uint32x2_t {aka __vector(2) unsigned int}’ for argument ‘2’ to ‘void vst1_lane_u32(uint32_t*, uint32x2_t, int)’
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:5785:35: error: cannot convert ‘const int8x8_t {aka const __vector(8) signed char}’ to ‘uint32x2_t {aka __vector(2) unsigned int}’ for argument ‘2’ to ‘void vst1_lane_u32(uint32_t*, uint32x2_t, int)’
fill_data_vec, 0);
^
tensorflow/lite/tools/make/Makefile:225: recipe for target '/tensorflow/tensorflow/lite/tools/make/gen/aarch64_armv8-a/obj/tensorflow/lite/kernels/depthwise_conv.o' failed
make: *** [/tensorflow/tensorflow/lite/tools/make/gen/aarch64_armv8-a/obj/tensorflow/lite/kernels/depthwise_conv.o] Error 1
make: *** Waiting for unfinished jobs....

最佳答案

在尝试解决问题数小时后,我想我找到了解决方案:

只需将“-flax-vector-conversions”参数添加到 tensorflow/lite/tools/make/Makefile 文件中的 CXXFLAGS 变量即可。

对我来说是第 58 行:

CXXFLAGS := -O3 -DNDEBUG -fPIC -flax-vector-conversions

之前的错误消失了,但现在我得到了另一个错误:

undefined reference to `shm_open'

之后,我在 tensorflow/lite/tools/make/targets/aarch64_makefile.inc 添加了“-lrt”

LIBS := \
-lstdc++ \
-lpthread \
-lm \
-ldl \
-lrt

并将 Makefile 中的 BUILD_WITH_NNAPI 更改为 false

编译过程有效。我会尽快测试TF库。

关于c++ - Tensorflow Lite arm64 错误 : cannot convert ‘const int8x8_t?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56055359/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com