Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no matching function for call to tflite::MicroInterpreter #36

Open
minnyqiu opened this issue Jun 8, 2023 · 1 comment
Open

no matching function for call to tflite::MicroInterpreter #36

minnyqiu opened this issue Jun 8, 2023 · 1 comment

Comments

@minnyqiu
Copy link

minnyqiu commented Jun 8, 2023

In file included from /Users/ballball/Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/micro/micro_error_reporter.h:19:0,
from /Users/ballball/Documents/Arduino/gesture/IMU_Classifier/IMU_Classifier.ino:25:
/Users/ballball/Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/experimental/micro/compatibility.h:29:0: warning: "TF_LITE_REMOVE_VIRTUAL_DELETE" redefined
#define TF_LITE_REMOVE_VIRTUAL_DELETE

In file included from /Users/ballball/Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/micro/all_ops_resolver.h:18:0,
from /Users/ballball/Documents/Arduino/gesture/IMU_Classifier/IMU_Classifier.ino:24:
/Users/ballball/Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/micro/compatibility.h:26:0: note: this is the location of the previous definition
#define TF_LITE_REMOVE_VIRTUAL_DELETE \

/Users/ballball/Documents/Arduino/gesture/IMU_Classifier/IMU_Classifier.ino: In function 'void setup()':
/Users/ballball/Documents/Arduino/gesture/IMU_Classifier/IMU_Classifier.ino:91:122: error: no matching function for call to 'tflite::MicroInterpreter::MicroInterpreter(const tflite::Model*&, tflite::AllOpsResolver&, byte [8192], const int&, tflite::MicroErrorReporter*)'
tflInterpreter = new tflite::MicroInterpreter(tflModel, tflOpsResolver, tensorArena, tensorArenaSize, &tflErrorReporter);
^
In file included from /Users/ballball/Documents/Arduino/gesture/IMU_Classifier/IMU_Classifier.ino:26:0:
/Users/ballball/Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/micro/micro_interpreter.h:60:3: note: candidate: tflite::MicroInterpreter::MicroInterpreter(const tflite::Model*, const tflite::MicroOpResolver&, tflite::MicroAllocator*, tflite::MicroResourceVariables*, tflite::MicroProfilerInterface*)
MicroInterpreter(const Model* model, const MicroOpResolver& op_resolver,
^~~~~~~~~~~~~~~~
/Users/ballball/Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/micro/micro_interpreter.h:60:3: note: no known conversion for argument 3 from 'byte [8192] {aka unsigned char [8192]}' to 'tflite::MicroAllocator*'
/Users/ballball/Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/micro/micro_interpreter.h:50:3: note: candidate: tflite::MicroInterpreter::MicroInterpreter(const tflite::Model*, const tflite::MicroOpResolver&, uint8_t*, size_t, tflite::MicroResourceVariables*, tflite::MicroProfilerInterface*)
MicroInterpreter(const Model* model, const MicroOpResolver& op_resolver,
^~~~~~~~~~~~~~~~
/Users/ballball/Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/micro/micro_interpreter.h:50:3: note: no known conversion for argument 5 from 'tflite::MicroErrorReporter*' to 'tflite::MicroResourceVariables*'
/Users/ballball/Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/micro/micro_interpreter.h:40:7: note: candidate: constexpr tflite::MicroInterpreter::MicroInterpreter(const tflite::MicroInterpreter&)
class MicroInterpreter {
^~~~~~~~~~~~~~~~
/Users/ballball/Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/micro/micro_interpreter.h:40:7: note: candidate expects 1 argument, 5 provided
/Users/ballball/Documents/Arduino/gesture/IMU_Classifier/IMU_Classifier.ino: In function 'void loop()':
/Users/ballball/Documents/Arduino/gesture/IMU_Classifier/IMU_Classifier.ino:152:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < NUM_GESTURES; i++) {

exit status 1

Compilation error: no matching function for call to 'tflite::MicroInterpreter::MicroInterpreter(const tflite::Model*&, tflite::AllOpsResolver&, byte [8192], const int&, tflite::MicroErrorReporter*)'

@palnitin24
Copy link

palnitin24 commented Jan 25, 2024

The issue you're facing due to "tflite::MicroInterpreter::MicroInterpreter(const tflite::Model*&, tflite::AllOpsResolver&, byte [8192], const int&, tflite::MicroErrorReporter*)" this line, to resolve it go to "Documents/Arduino/libraries/Arduino_TensorFlowLite/src/tensorflow/lite/micro/micro_interpreter.h"

And check whether the

MicroInterpreter(const Model* model, const MicroOpResolver& op_resolver,
         uint8_t* tensor_arena, size_t tensor_arena_size,
         MicroResourceVariables* resource_variables = nullptr,
         MicroProfilerInterface* profiler = nullptr);

is like the above lines of code in your file and if yes then go to imu_classifier and replace the line in your imu_classifier with the modified line.

Here is the modified line:
tflInterpreter = new tflite::MicroInterpreter(tflModel, tflOpsResolver, tensorArena, tensorArenaSize, nullptr, nullptr);

Adjust the uint 8 with the below code

constexpr int tensorArenaSize = 8 * 1024;
uint8_t tensorArena[tensorArenaSize] __attribute__((aligned(16)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants