#include <cstdint> error

I’m trying to use TensorFlow Lite for Microcontrollers, but I’m having issues with compiling the sketch (I’m just running the Hello World example for now).

the error output is:
In file included from C:\Users\Admin\Documents\Arduino\sparkfun_tensorflowlite_sine\sparkfun_tensorflowlite_sine.ino:16:0:
C:\Users\Admin\Documents\Arduino\sparkfun_tensorflowlite_sine\tensorflow\lite\micro\micro_interpreter.h:24:10: fatal error: cstdint: No such file or directory
#include
^~~~~~~~~
compilation terminated.
exit status 1
I have tried the Solution that download “ArduinoSTL” and “StandardCplusplus” and include them into my arduino project, but it still error as shown above.

Does anyone have any idea why the sketch can’t be compiled, and if so, how to resolve the issue?

isn't is stdint.h?

I doubt TensorFlow Lite is supported on 8-bit AVR microcontrollers.

The C++ standard library, including <cstdint> is not included in the AVR toolchain. You could install it using a third-party library, but that doesn't change the fact that TensorFlow Lite is not intended to work on AVR.

<stdint.h> is the C header, the correct C++ header is indeed <cstdint>, but it doesn't exist on AVR.

Thans for your reply. I want to know how can I install the <cstdint> ? I have search it for a long time, I have tried some solution like I said in the article. Can I search it on the github?

Switch to an "Arduino" board that contains an ARM-based or ESP-based processor.

This isn't going to fix anything. You need a board that is supported by TensorFlow Lite, see https://www.tensorflow.org/lite/microcontrollers#supported_platforms.

Thank you for your reply. I would like to know how to select and add sparkfun boards. No relevant information can be found in the board information.

Please provide a detailed description of what you mean by "add sparkfun boards". What do you want to add them to?

It is in the development board selection window, you can find the corresponding development board information through the options selected by the development board manager, but I did not find the sparkfunf development board.

OK, thanks for the clarification. I understand now. You can find the instructions here:
https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager

Please let us know if you have any questions about that process or any problems while following it.

Thank you for your reply. The problem of the development board has been solved, but I have encountered a new problem. I followed the tutorial to import the program. After I solved some of the problems, the problems now appear as follows:

In file included from C:\Users\Admin\Documents\Arduino\sparkfun_tensorflowlite_sine\sparkfun_tensorflowlite_sine.ino:8:
C:\Users\Admin\Documents\Arduino\sparkfun_tensorflowlite_sine\tensorflow\lite\micro\micro_interpreter.h:17:10: fatal error: system_configuration.h: No such file or directory
#include <system_configuration.h>
^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
An error occurred while compiling for the development board SparkFun Edge.

I use... instead of the similar part of the error. Is there a problem with the StandardCplusplus-master library I installed? Is there a version restriction?


I want to ask if it is related to the version of tensorflowlite. I am not using the latest version here. The content in the video tutorial is used. The tensorflow folder is downloaded from the website (GitHub - tensorflow/tensorflow: An Open Source Machine Learning Framework for Everyone )

#include "TensorFlowLite.h"
#include "tensorflow/lite/micro/kernels/micro_ops.h"
#include "tensorflow/lite/micro/micro_error_reporter.h"
#include "tensorflow/lite/micro/micro_interpreter.h"
#include "tensorflow/lite/micro/micro_mutable_op_resolver.h"
#include "tensorflow/lite/version.h"
#include "sine_model.h"

I have another question. There is no ‘’tensorflow/lite/version‘’.h in the tensorflow folder on the Internet, but there is only this path in the tutorial. Now it is still compiled here. The first #include above cannot compile normally. .

If you can help me solve it, I would be very grateful.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.