[ 57%] Building C object _deps/xnnpack-build/CMakeFiles/XNNPACK.dir/src/qs8-gavgpool/gen/7p7x-minmax-neon-c8-acc2.c.o
/home/pi/work/tflite_build/xnnpack/src/qs8-gavgpool/gen/7x-minmax-neon-c16-acc2.c: In function ‘xnn_qs8_gavgpool_minmax_ukernel_7x__neon_c16_acc2’:
/home/pi/work/tflite_build/xnnpack/src/qs8-gavgpool/gen/7x-minmax-neon-c16-acc2.c:174:5: note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts
     int8x16_t vout0123456789ABCDEF = vcombine_s16(vqmovn_s16(vacc01234567), vqmovn_s16(vacc89ABCDEF));
     ^~~~~~~~~
/home/pi/work/tflite_build/xnnpack/src/qs8-gavgpool/gen/7x-minmax-neon-c16-acc2.c:174:51: error: incompatible type for argument 1 of ‘vcombine_s16’
     int8x16_t vout0123456789ABCDEF = vcombine_s16(vqmovn_s16(vacc01234567), vqmovn_s16(vacc89ABCDEF));

[링크 : https://www.gitmemory.com/issue/tensorflow/tensorflow/47536/809003416]

 

DNN을 빼고 해보면 된다는데

$ cmake ../tensorflow/tensorflow/lite -DTFLITE_ENABLE_GPU=ON -DTFLITE_ENABLE_XNNPACK=OFF

 

안되잖아!?!

[ 41%] Building CXX object CMakeFiles/tensorflow-lite.dir/delegates/gpu/api.cc.o
In file included from /home/pi/work/tensorflow/tensorflow/lite/delegates/gpu/common/util.h:19,
                 from /home/pi/work/tensorflow/tensorflow/lite/delegates/gpu/api.h:45,
                 from /home/pi/work/tensorflow/tensorflow/lite/delegates/gpu/api.cc:16:
/home/pi/work/tensorflow/tensorflow/lite/delegates/gpu/common/types.h:23:10: fatal error: fp16.h: No such file or directory
 #include <fp16.h>
          ^~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/tensorflow-lite.dir/build.make:188: CMakeFiles/tensorflow-lite.dir/delegates/gpu/api.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1751: CMakeFiles/tensorflow-lite.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

 

+

ARMCC_FLAGS="-march=armv7-a -mfpu=neon-vfpv4 -funsafe-math-optimizations"
cmake -DCMAKE_C_COMPILER=${ARMCC_PREFIX}gcc \
  -DCMAKE_CXX_COMPILER=${ARMCC_PREFIX}g++ \
  -DCMAKE_C_FLAGS="${ARMCC_FLAGS}" \
  -DCMAKE_CXX_FLAGS="${ARMCC_FLAGS}" \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
  -DCMAKE_SYSTEM_NAME=Linux \
  -DCMAKE_SYSTEM_PROCESSOR=armv7 \
  -DTFLITE_ENABLE_GPU=ON -DTFLITE_ENABLE_XNNPACK=OFF \
  ../tensorflow/tensorflow/lite  

 

아래는 크로스컴파일 하는 예

$ curl -LO https://storage.googleapis.com/mirror.tensorflow.org/developer.arm.com/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz
$ mkdir -p ${HOME}/toolchains
$ tar xvf gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf.tar.xz -C ${HOME}/toolchains

$ ARMCC_FLAGS="-march=armv7-a -mfpu=neon-vfpv4 -funsafe-math-optimizations"
ARMCC_PREFIX=${HOME}/toolchains/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
cmake -DCMAKE_C_COMPILER=${ARMCC_PREFIX}gcc \
  -DCMAKE_CXX_COMPILER=${ARMCC_PREFIX}g++ \
  -DCMAKE_C_FLAGS="${ARMCC_FLAGS}" \
  -DCMAKE_CXX_FLAGS="${ARMCC_FLAGS}" \
  -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
  -DCMAKE_SYSTEM_NAME=Linux \
  -DCMAKE_SYSTEM_PROCESSOR=armv7 \
  ../tensorflow/lite/

[링크 : https://www.tensorflow.org/lite/guide/build_cmake_arm]

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

tf release 2.7.0-rc  (0) 2021.10.12
tflite delegate  (0) 2021.10.11
tf lite cmake  (0) 2021.08.27
tensorflow cross compile  (0) 2021.07.01
tensorflow lite on rpi4 64bit  (0) 2021.06.30
Posted by 구차니