簡體   English   中英

使用 arm-none-eabi-gcc 為微控制器編譯一個 TensorFlow Lite 項目

[英]Compile a TensorFlow Lite project for microcontrollers with arm-none-eabi-gcc

我剛剛從 github ( https://github.com/tensorflow/tensorflow (v.2.3.1)) 下載了 TensorFlow 存儲庫。 我將它包含在我的 C++ 項目中。 在我創建 Makefile 之后,我得到了錯誤:

make
arm-none-eabi-gcc -L -std=c11 -Wall -Wextra --pedantic -DSTM32 -DSTM32F7 -DSTM32F746xx -DSTM32F746NGHx -DSTM32F746G_DISCO -mcpu=cortex-m7 -mlittle-endian -mfloat-abi=hard -mfpu=fpv5-sp-d16 -mthumb -specs=nosys.specs  -DNDEBUG -nostartfiles -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-Map=EMNIST.map -I ./inc -I ./lcd/inc -I ./../../STM32F7_library/Drivers/CMSIS/Include -I ./../../STM32F7_library/Drivers/CMSIS/Device/ST/STM32F7xx/Include -I ./../../STM32F7_library/Drivers/STM32F7xx_HAL_Driver/Inc -I ./../../STM32F7_library/Drivers/BSP/STM32746G-Discovery -I ./../../STM32F7_library/Utilities/Log -I ./../../STM32F7_library/Drivers/BSP/Components/ft5336   -c -o ../../TensorFlow_library/tensorflow/lite/c/c_api_internal.o ../../TensorFlow_library/tensorflow/lite/c/c_api_internal.c
../../TensorFlow_library/tensorflow/lite/c/c_api_internal.c:16:46: fatal error: tensorflow/lite/c/c_api_internal.h: No such file or directory
 #include "tensorflow/lite/c/c_api_internal.h"

我不知道為什么會出現這個錯誤。 我是否必須將 TensorFlow 庫中的所有包含項從絕對路徑更改為相對路徑? 或者我可以在 Makefile 或類似的東西中設置一些標志,以便我可以使用絕對路徑嗎? 任何人都可以嗎? 謝謝!

我得到了解決方案。
在您的 Makefile 中,您必須包含 TensorFlow 庫的目錄。

我的 Makefile 的這一部分在我的案例中看起來是這樣的:\

Includes and Defines\
INCLUDES += -I ./inc\
INCLUDES += -I ./lcd/inc\
INCLUDES += -I ./STM32F7_library/Drivers/CMSIS/Include\
INCLUDES += -I ./STM32F7_library/Drivers/CMSIS/Device/ST/STM32F7xx/Include\
INCLUDES += -I ./STM32F7_library/Drivers/STM32F7xx_HAL_Driver/Inc\
INCLUDES += -I ./STM32F7_library/Drivers/BSP/STM32746G-Discovery\
INCLUDES += -I ./STM32F7_library/Utilities/Log\
INCLUDES += -I ./STM32F7_library/Drivers/BSP/Components/ft5336\
INCLUDES += -I ./TensorFlow_library

TensorFlow 庫存放在“TensorFlow_library”文件夾中。 當您如下所示包含它時,您可以使用具有絕對路徑的 TensorFlow 庫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM