undefined reference to `DebugLog' in micro_error_reporter.cpp
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 25/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- arduino, cpp
- Domaine
- embedded-iot, machine-learning
Piste de recherche
Commencez par la sortie de l'éditeur de liens pour Arduino_TensorFlowLite-2.4.0-ALPHA-precompiled et les lignes 35–36 référencées de tensorflow/lite/micro/micro_error_reporter.cpp. Examinez le sketch inclus, en particulier sa configuration de MicroErrorReporter, et déterminez ce qui provoque l'absence du symbole DebugLog. La tâche est terminée lorsque le sketch se compile sans erreurs undefined-reference.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
I am working with Arduino_TensorFlowLite-2.4.0-ALPHA-precompiled library and trying to compile my arduino sketch. But I keep getting this error Library Arduino_TensorFlowLite has been declared precompiled:
Using precompiled library in C:\Users\prane\Documents\Arduino\libraries\Arduino_TensorFlowLite-2.4.0-ALPHA-precompiled\src\cortex-m4\fpv4-sp-d16-softfp
C:\Users\prane\Documents\Arduino\libraries\Arduino_TensorFlowLite-2.4.0-ALPHA-precompiled\src\cortex-m4\fpv4-sp-d16-softfp\libtensorflowlite.a(micro_error_reporter.cpp.o): In function tflite::MicroErrorReporter::Report(char const*, std::__va_list)':
/home/arduino/workspace/Libraries-Google-Tensorflow-scraper/Arduino/libraries/tensorflow_lite_mirror/src/tensorflow/lite/micro/micro_error_reporter.cpp:35: undefined reference to DebugLog'
/home/arduino/workspace/Libraries-Google-Tensorflow-scraper/Arduino/libraries/tensorflow_lite_mirror/src/tensorflow/lite/micro/micro_error_reporter.cpp:36: undefined reference to DebugLog'
collect2.exe: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1`
I've included my sketch below. Any help would be greatly helpful. Thanks
`#include "TensorFlowLite.h"
#include "tensorflow/lite/micro/all_ops_resolver.h"
#include "tensorflow/lite/micro/micro_error_reporter.h"
#include "tensorflow/lite/micro/micro_interpreter.h"
//#include "tensorflow/lite/micro/system_setup.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/version.h"
#include "image_data.h"
#include "model_data.h"
const int kInputTensorSize = 1 * 28 * 28 * 1;
const int kNumClasses = 10;
namespace{
tflite::ErrorReporter* error_reporter = nullptr;
const tflite::Model* model = nullptr;
tflite::MicroInterpreter* interpreter = nullptr;
TfLiteTensor* input = nullptr;
TfLiteTensor* output = nullptr;
int inference_count = 0;
constexpr int kTensorArenaSize = 2*1024;
uint8_t tensor_arena[kTensorArenaSize];
}
void setup() {
Serial.begin(115200);
// tflite::InitializeTarget();
// memset(tensor_arena, 0, kTensorArenaSize*sizeof(uint8_t));
// Set up logging.
static tflite::MicroErrorReporter micro_error_reporter;
error_reporter = µ_error_reporter;
model = tflite::GetModel(model_data);
if (model->version() != TFLITE_SCHEMA_VERSION) {
Serial.println("Model provided is schema version "
+ String(model->version()) + " not equal "
+ "to supported version "
+ String(TFLITE_SCHEMA_VERSION));
return;
} else {
Serial.println("Model version: " + String(model->version()));
}
// This pulls in all the operation implementations we need.
static tflite::AllOpsResolver resolver;
// Build an interpreter to run the model with.
static tflite::MicroInterpreter static_interpreter(
model, resolver, tensor_arena, kTensorArenaSize, error_reporter);
interpreter = &static_interpreter;
// Build an interpreter to run the model with.
// tflite::MicroInterpreter* static_interpreter_ptr = new tflite::MicroInterpreter(
// model, resolver, tensor_arena, kTensorArenaSize, error_reporter);
// interpreter = static_interpreter_ptr;
// Allocate memory from the tensor_arena for the model's tensors.
TfLiteStatus allocate_status = interpreter->AllocateTensors();
if (allocate_status != kTfLiteOk) {
Serial.println("AllocateTensors() failed");
return;
} else {
Serial.println("AllocateTensor() Success");
}
size_t used_size = interpreter->arena_used_bytes();
Serial.println("Area used bytes: " + String(used_size));
input = interpreter->input(0);
output = interpreter->output(0);
/* check input */
if (input->type != kTfLiteFloat32) {
Serial.println("input type mismatch. expected input type is float32");
return;
} else {
Serial.println("input type is float32");
}
Serial.println("Model input:");
Serial.println("input->type: " + String(input->type));
Serial.println("dims->size: " + String(input->dims->size));
for (int n = 0; n < input->dims->size; ++n) {
Serial.println("dims->data[n]: " + String(input->dims->data[n]));
}
Serial.println("Model output:");
Serial.println("dims->size: " + String(output->dims->size));
for (int n = 0; n < output->dims->size; ++n) {
Serial.println("dims->data[n]: " + String(output->dims->data[n]));
}
}
void loop() {
// Define the input image array
const uint8_t* kImageDataPtr = kImageData; // Pointer to start of image data
uint8_t input_image[kInputTensorSize];
for (int i = 0; i < kInputTensorSize; i++) {
input_image[i] = *(kImageDataPtr++);
}
for(int i=0; i<kInputTensorSize; i++){
input->data.f[i] = (float)input_image[i] / 255.0;
}
// Run inference
interpreter->Invoke();
// Print the predicted class
int predicted_class = -1;
float max_score = -1;
for (int i = 0; i < kNumClasses; i++) {
float score = output->data.f[i];
if (score > max_score) {
predicted_class = i;
max_score = score;
}
}
Serial.println(predicted_class);
}`
- Langage dominant
- Jupyter Notebook
- Étoiles
- 269
- Forks
- 122
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de arduino/ArduinoTensorFlowLiteTutorials
-
Tinyml Workshop Runtime ErrorOuverte
Difficulté 3/5 1-2 jours Accessibilité débutants 38/100
arduino/ArduinoTensorFlowLiteTutorials#37 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
arduino/ArduinoTensorFlowLiteTutorials#36 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 30/100
arduino/ArduinoTensorFlowLiteTutorials#34 · 5 commentaires ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 25/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
arduino/ArduinoTensorFlowLiteTutorials#32 · 2 commentaires · 1 réaction ·
Toutes les issues de arduino/ArduinoTensorFlowLiteTutorials
Issues similaires
-
Examples say cnxOuvertedocumentation embedded
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
rusefi/rusefi#10401 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Fw::Time::add(F64) asserts when the fraction rounds up to a full second and the time already holds 999999 microsecondsPeut-être pris @auraseb l’a pris il y a 1 jour. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 63/100
meshcore-dev/MeshCore#3622 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100