Skip to content

Error building Tensorflow Lite on AARCH64 #26731

@weihChen

Description

@weihChen

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04
  • TensorFlow installed from (source or binary): N/A
  • TensorFlow version: the latest
  • Python version: N/A
  • Installed using virtualenv? pip? conda?: N/A
  • Bazel version (if compiling from source): N/A
  • GCC/Compiler version (if compiling from source): gcc version 5.4.0 20160609
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A

Describe the problem
I am trying to build Tensorflow Lite for ARM64 boards.
I followed the instructions on https://tensorflow.google.cn/lite/guide/build_arm64 and executed the following commands:

sudo apt-get update
sudo apt-get install crossbuild-essential-arm64
./tensorflow/lite/tools/make/download_dependencies.sh
./tensorflow/lite/tools/make/build_aarch64_lib.sh

But at the last step got lots of errors such as:

./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3823:22: note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts
filter_reg_0_b = vdupq_n_u8(kSignBit);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3823:22: error: cannot convert ‘uint8x16_t {aka __vector(16) unsigned char}’ to ‘int8x16_t {aka __vector(16) signed char}’ in assignment
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3824:22: error: cannot convert ‘uint8x16_t {aka __vector(16) unsigned char}’ to ‘int8x16_t {aka __vector(16) signed char}’ in assignment
filter_reg_1_b = vdupq_n_u8(kSignBit);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3825:22: error: cannot convert ‘uint8x16_t {aka __vector(16) unsigned char}’ to ‘int8x16_t {aka __vector(16) signed char}’ in assignment
filter_reg_2_b = vdupq_n_u8(kSignBit);
^
In file included from ./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h:21:0,
from tensorflow/lite/kernels/depthwise_conv.cc:25:
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:50:71: error: cannot convert ‘int8x16_t {aka __vector(16) signed char}’ to ‘uint64x2_t {aka __vector(2) long unsigned int}’ for argument ‘2’ to ‘uint64x2_t vld1q_lane_u64(const uint64_t*, uint64x2_t, int)’
vld1q_lane_u64(reinterpret_cast<const uint64_t*>(src), reg, lane_num)
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3828:24: note: in expansion of macro ‘vld1q_lane_s8x8’
filter_reg_0_a = vld1q_lane_s8x8(filter_block_ptr, filter_reg_0_a, 0);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:50:71: error: cannot convert ‘int8x16_t {aka __vector(16) signed char}’ to ‘uint64x2_t {aka __vector(2) long unsigned int}’ for argument ‘2’ to ‘uint64x2_t vld1q_lane_u64(const uint64_t*, uint64x2_t, int)’
vld1q_lane_u64(reinterpret_cast<const uint64_t*>(src), reg, lane_num)
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3830:24: note: in expansion of macro ‘vld1q_lane_s8x8’
filter_reg_0_b = vld1q_lane_s8x8(filter_block_ptr, filter_reg_0_b, 0);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:50:71: error: cannot convert ‘int8x16_t {aka __vector(16) signed char}’ to ‘uint64x2_t {aka __vector(2) long unsigned int}’ for argument ‘2’ to ‘uint64x2_t vld1q_lane_u64(const uint64_t*, uint64x2_t, int)’
vld1q_lane_u64(reinterpret_cast<const uint64_t*>(src), reg, lane_num)
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3832:24: note: in expansion of macro ‘vld1q_lane_s8x8’
filter_reg_0_a = vld1q_lane_s8x8(filter_block_ptr, filter_reg_0_a, 1);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:50:71: error: cannot convert ‘int8x16_t {aka __vector(16) signed char}’ to ‘uint64x2_t {aka __vector(2) long unsigned int}’ for argument ‘2’ to ‘uint64x2_t vld1q_lane_u64(const uint64_t*, uint64x2_t, int)’
vld1q_lane_u64(reinterpret_cast<const uint64_t*>(src), reg, lane_num)
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3834:24: note: in expansion of macro ‘vld1q_lane_s8x8’
filter_reg_1_a = vld1q_lane_s8x8(filter_block_ptr, filter_reg_1_a, 0);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:50:71: error: cannot convert ‘int8x16_t {aka __vector(16) signed char}’ to ‘uint64x2_t {aka __vector(2) long unsigned int}’ for argument ‘2’ to ‘uint64x2_t vld1q_lane_u64(const uint64_t*, uint64x2_t, int)’
vld1q_lane_u64(reinterpret_cast<const uint64_t*>(src), reg, lane_num)
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3836:24: note: in expansion of macro ‘vld1q_lane_s8x8’
filter_reg_1_b = vld1q_lane_s8x8(filter_block_ptr, filter_reg_1_b, 0);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:50:71: error: cannot convert ‘int8x16_t {aka __vector(16) signed char}’ to ‘uint64x2_t {aka __vector(2) long unsigned int}’ for argument ‘2’ to ‘uint64x2_t vld1q_lane_u64(const uint64_t*, uint64x2_t, int)’
vld1q_lane_u64(reinterpret_cast<const uint64_t*>(src), reg, lane_num)
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3838:24: note: in expansion of macro ‘vld1q_lane_s8x8’
filter_reg_1_a = vld1q_lane_s8x8(filter_block_ptr, filter_reg_1_a, 1);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:50:71: error: cannot convert ‘int8x16_t {aka __vector(16) signed char}’ to ‘uint64x2_t {aka __vector(2) long unsigned int}’ for argument ‘2’ to ‘uint64x2_t vld1q_lane_u64(const uint64_t*, uint64x2_t, int)’
vld1q_lane_u64(reinterpret_cast<const uint64_t*>(src), reg, lane_num)
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3840:24: note: in expansion of macro ‘vld1q_lane_s8x8’
filter_reg_2_a = vld1q_lane_s8x8(filter_block_ptr, filter_reg_2_a, 0);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:50:71: error: cannot convert ‘int8x16_t {aka __vector(16) signed char}’ to ‘uint64x2_t {aka __vector(2) long unsigned int}’ for argument ‘2’ to ‘uint64x2_t vld1q_lane_u64(const uint64_t*, uint64x2_t, int)’
vld1q_lane_u64(reinterpret_cast<const uint64_t*>(src), reg, lane_num)
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3842:24: note: in expansion of macro ‘vld1q_lane_s8x8’
filter_reg_2_b = vld1q_lane_s8x8(filter_block_ptr, filter_reg_2_b, 0);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:50:71: error: cannot convert ‘int8x16_t {aka __vector(16) signed char}’ to ‘uint64x2_t {aka __vector(2) long unsigned int}’ for argument ‘2’ to ‘uint64x2_t vld1q_lane_u64(const uint64_t*, uint64x2_t, int)’
vld1q_lane_u64(reinterpret_cast<const uint64_t*>(src), reg, lane_num)
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3844:24: note: in expansion of macro ‘vld1q_lane_s8x8’
filter_reg_2_a = vld1q_lane_s8x8(filter_block_ptr, filter_reg_2_a, 1);
^
In file included from ./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8.h:21:0,
from tensorflow/lite/kernels/depthwise_conv.cc:25:
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3846:57: error: cannot convert ‘const uint8x16_t {aka const __vector(16) unsigned char}’ to ‘int8x16_t {aka __vector(16) signed char}’ for argument ‘2’ to ‘int8x16_t veorq_s8(int8x16_t, int8x16_t)’
filter_reg_0_a = veorq_s8(filter_reg_0_a, sign_bit);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3847:57: error: cannot convert ‘const uint8x16_t {aka const __vector(16) unsigned char}’ to ‘int8x16_t {aka __vector(16) signed char}’ for argument ‘2’ to ‘int8x16_t veorq_s8(int8x16_t, int8x16_t)’
filter_reg_0_b = veorq_s8(filter_reg_0_b, sign_bit);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3848:57: error: cannot convert ‘const uint8x16_t {aka const __vector(16) unsigned char}’ to ‘int8x16_t {aka __vector(16) signed char}’ for argument ‘2’ to ‘int8x16_t veorq_s8(int8x16_t, int8x16_t)’
filter_reg_1_a = veorq_s8(filter_reg_1_a, sign_bit);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3849:57: error: cannot convert ‘const uint8x16_t {aka const __vector(16) unsigned char}’ to ‘int8x16_t {aka __vector(16) signed char}’ for argument ‘2’ to ‘int8x16_t veorq_s8(int8x16_t, int8x16_t)’
filter_reg_1_b = veorq_s8(filter_reg_1_b, sign_bit);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3850:57: error: cannot convert ‘const uint8x16_t {aka const __vector(16) unsigned char}’ to ‘int8x16_t {aka __vector(16) signed char}’ for argument ‘2’ to ‘int8x16_t veorq_s8(int8x16_t, int8x16_t)’
filter_reg_2_a = veorq_s8(filter_reg_2_a, sign_bit);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3851:57: error: cannot convert ‘const uint8x16_t {aka const __vector(16) unsigned char}’ to ‘int8x16_t {aka __vector(16) signed char}’ for argument ‘2’ to ‘int8x16_t veorq_s8(int8x16_t, int8x16_t)’
filter_reg_2_b = veorq_s8(filter_reg_2_b, sign_bit);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h: In static member function ‘static void tflite::optimized_ops::depthwise_conv::PackMacroBlock<(tflite::DepthwiseConvImplementation)3, (tflite::DepthwiseConvDepthMultiplication)0, 0>::PackMacroBlockNeon(const uint8*, int8*, const tflite::optimized_ops::depthwise_conv::DepthwiseConvDotProdParams*)’:
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3954:53: error: cannot convert ‘uint8x16_t {aka __vector(16) unsigned char}’ to ‘const int8x16_t {aka const __vector(16) signed char}’ in initialization
const int8x16_t perm_data_0 = vld1q_u8(perm_data);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3955:58: error: cannot convert ‘uint8x16_t {aka __vector(16) unsigned char}’ to ‘const int8x16_t {aka const __vector(16) signed char}’ in initialization
const int8x16_t perm_data_1 = vld1q_u8(perm_data + 16);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3956:58: error: cannot convert ‘uint8x16_t {aka __vector(16) unsigned char}’ to ‘const int8x16_t {aka const __vector(16) signed char}’ in initialization
const int8x16_t perm_data_2 = vld1q_u8(perm_data + 32);
^
./tensorflow/lite/kernels/internal/optimized/depthwiseconv_uint8_3x3_filter.h:3957:58: error: cannot convert ‘uint8x16_t {aka __vector(16) unsigned char}’ to ‘const int8x16_t {aka const __vector(16) signed char}’ in initialization
const int8x16_t perm_data_3 = vld1q_u8(perm_data + 48);

How can I fix it?

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions