0

全部,

我正在尝试为我的目标处理器 ARM926EJ-S 处理器(ARM5te 架构)构建 tensorflow lite。我已经从 Rasp PI 构建脚本和设置中为我的目标处理器复制了构建脚本和构建设置。这是我在 arm926_makefile.inc 中的目标处理器的构建设置:

# Settings for ARM926.
ifeq ($(TARGET),arm926)
  TARGET_ARCH := armv5te

  ifeq ($(TARGET_ARCH), armv5te)
    TARGET_TOOLCHAIN_PREFIX := //arm-eabi-uclibc/usr/bin/arm-linux-
    CXXFLAGS += \
      -march=armv5te \
      -mcpu=arm926ej-s \
      -funsafe-math-optimizations \
      -ftree-vectorize \
      -fPIC

    CFLAGS += \
      -march=armv5te \
      -mcpu=arm926ej-s \
      -funsafe-math-optimizations \
      -ftree-vectorize \
      -std=c99 \
      -fPIC

    LDFLAGS := \
      -Wl,--no-export-dynamic \
      -Wl,--exclude-libs,ALL \
      -Wl,--gc-sections \
      -Wl,--as-needed
  endif

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

endif

构建脚本成功构建了一堆文件。但是,它主要抱怨数学函数,如 std 命名空间的 round、atoi、min、max。我的目标处理器的工具链版本是 arm-linux-g++ (Buildroot 2014.08) 4.9.2。相同的 tensorflow lite 使用 Pi 工具链版本 arm-linux-gnueabihf-g++ (GCC) 8.3.0 成功构建。

我确实看到了在我的工具链中声明和定义的那些数学函数,但它们没有被 tensorflow-lite 构建识别。顺便说一句..我尝试使用 global ::round() 然后它也需要替换很多地方和其他数学函数。必须有简单的方法或传递一些配置才能从我的工具链中启用这些功能。

有人可以指出我为 ARM926 构建 tensorflow-lite 的正确方向吗?

以下是我的工具链中的构建错误:

./tensorflow/lite/kernels/internal/reference/reduce.h:385:71: error: no matching function for call to 'min(double, float)'
./tensorflow/lite/kernels/internal/round.h:34:10: error: 'round' is not a member of 'std'
   return std::round(x);
/tensorflow/tensorflow/lite/tools/make/downloads/eigen/Eigen/src/Core/GlobalFunctions.h:93:36: note:   'Eigen::round'
   EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(round,scalar_round_op,nearest integer,\sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round)
./tensorflow/lite/kernels/internal/reference/concatenation.h:125:36: error: 'round' is not a member of 'std'
./tensorflow/lite/kernels/internal/reference/reduce.h:374:28: error: 'round' is not a member of 'std'

顺便说一句..我还尝试使用最新的 Rasp Pi 工具链为我的目标处理器构建 tensorflow lite,使用编译选项 -march=armv5te 和 -mcpu=arm926ej-s。它构建但不运行 - 我认为 rasp pi 工具链不会为 ARM926 和 ARMv5te CPU 架构生成正确的机器代码。

我将不胜感激并欢迎任何指针或想法来解决 ARM9 处理器的这个 tensorflow-lite 构建问题。

谢谢,手臂

4

0 回答 0