C:\Users\prane\Documents\Arduino\libraries\tensorflow\mnist\mnist.ino:3:10: fatal error: tensorflow/lite/micro/kernels/micro_ops.h: No such file or directory
#include "tensorflow/lite/micro/kernels/micro_ops.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: tensorflow/lite/micro/kernels/micro_ops.h: No such file or directory
I dont think the full sketch will be helpful, as the problem is not being able to detect the file inside the library. and the same problem occurs irrespective of the main sketch anyway I have provided the full code below
#include "TensorFlowLite.h"
#include "main_functions.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/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
#include "mnist.h"
#define TFLITE_MINIMAL_CHECK(x) \
if (!(x)) { \
error_reporter->Report("Error at %s:%d\n", __FILE__, __LINE__); \
return kTfLiteError; \
}
// Return the top k results.
constexpr int kNumResults = 3;
constexpr float kThreshold = 0.1f;
namespace {
tflite::ErrorReporter* error_reporter = nullptr;
const tflite::Model* model = nullptr;
tflite::MicroInterpreter* interpreter = nullptr;
TfLiteTensor* input = nullptr;
TfLiteTensor* output = nullptr;
// Create an area of memory to use for input, output, and intermediate arrays.
constexpr int kTensorArenaSize = 60 * 1024;
uint8_t tensor_arena[kTensorArenaSize];
void GetTopN(int32_t* prediction, int num_results, float threshold,
int* top_N, int& output_size) {
// Find the top-N results.
int32_t max_value = -1;
int max_index = -1;
for (int i = 0; i < num_results; ++i) {
for (int j = 0; j < 10; ++j) {
if (prediction[j] > max_value) {
max_value = prediction[j];
max_index = j;
}
}
if (max_value < threshold) {
output_size = i;
return;
}
top_N[i] = max_index;
prediction[max_index] = -1;
max_index = -1;
max_value = -1;
}
output_size = num_results;
}
} // namespace
void setup() {
// Set up logging. Google style is to avoid globals or statics because of
// lifetime uncertainty, but since this routine is only called once, we can
// make an exception.
static tflite::MicroErrorReporter micro_error_reporter;
error_reporter = µ_error_reporter;
Good plan. Which version of Arduino IDE are you using (e.g., "2.0.1")? The version is shown on the window title bar and also in the Help > About dialog.
I ask for this information because I want to give you the appropriate instructions for the IDE version you are using.
Hi @mrunaliontra. Please provide a detailed description of the problem you are having. Make sure to include the full and exact text of any error or warning messages you encountered.