Skip to content

Commit 8fa2ea4

Browse files
committed
Remove unused error reporter references in TensorFlow Lite integration
1 parent 0babc62 commit 8fa2ea4

File tree

6 files changed

+30
-128
lines changed

6 files changed

+30
-128
lines changed

scripts/build_and_check.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
set -e
44

5+
# Print/speak build completion on exit (whether successful or not)
6+
function finish {
7+
echo "Build complete for board ${BOARD}"
8+
if [[ "$OSTYPE" == "darwin"* ]]; then
9+
say "Finished building"
10+
else
11+
echo "Build complete"
12+
fi
13+
}
14+
trap finish EXIT
15+
516
BOARD=${1:-MICROLITE}
617
IDF_VERSION=${IDF_VERSION:-v5.2.2}
718

@@ -41,6 +52,9 @@ popd >/dev/null
4152
pushd boards/${BOARD} >/dev/null
4253
rm -rf build
4354

55+
56+
cd ../../third_party/micropython/ports/esp32
57+
4458
# Inject flags so that:
4559
# • C builds drop -Werror=stringop-overflow
4660
# • C++ builds retain -fno-rtti
@@ -51,4 +65,4 @@ chmod +x ../../scripts/assemble-unified-image-esp.sh
5165
../../scripts/assemble-unified-image-esp.sh ../../third_party/micropython/ports/esp32
5266
popd >/dev/null
5367

54-
echo "Build complete for board ${BOARD}"
68+
# (No need for a final echo/say here—it's handled by the EXIT trap.)

src/manifest.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
1-
# Include the board's default manifest.
2-
include("$(PORT_DIR)/boards/manifest.py")
1+
freeze("$(PORT_DIR)/modules")
2+
include("$(MPY_DIR)/extmod/asyncio")
3+
4+
# Useful networking-related packages.
5+
require("bundle-networking")
6+
7+
# Require some micropython-lib modules.
8+
require("aioespnow")
9+
require("dht")
10+
require("ds18x20")
11+
require("neopixel")
12+
require("onewire")
13+
require("umqtt.robust")
14+
require("umqtt.simple")
15+
require("upysh")

src/microlite/micropython-error-reporter.cpp

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/microlite/micropython-error-reporter.h

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/microlite/openmv-libtf.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@
66
// Copied and modified for using with newer tflite-micro sources
77

88
#include "python_ops_resolver.h"
9-
#include "tensorflow/lite/micro/tflite_bridge/micro_error_reporter.h"
109
#include "tensorflow/lite/micro/micro_interpreter.h"
1110
#include "tensorflow/lite/schema/schema_generated.h"
1211

1312
#include "tensorflow-microlite.h"
1413
#include "openmv-libtf.h"
15-
#include "micropython-error-reporter.h"
1614
#include <stdio.h>
1715

1816
extern "C" {
19-
static microlite::MicropythonErrorReporter micro_error_reporter;
2017
/*
2118
Return the index'th tensor
2219
*/
@@ -59,9 +56,6 @@ extern "C" {
5956

6057
int libtf_interpreter_init(microlite_interpreter_obj_t *microlite_interpreter) {
6158

62-
// The error reporter
63-
tflite::ErrorReporter *error_reporter = &micro_error_reporter;
64-
6559
// Get the tflite model from the model data
6660
const tflite::Model *model = tflite::GetModel(microlite_interpreter->model_data->items);
6761

@@ -75,9 +69,6 @@ extern "C" {
7569
// return 1;
7670
// }
7771

78-
// Set the tensorflow error reporter
79-
microlite_interpreter->tf_error_reporter = (mp_obj_t)error_reporter;
80-
8172
// Set the tensorflow model
8273
microlite_interpreter->tf_model = (mp_obj_t)model;
8374

src/microlite/tensorflow-microlite.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ typedef struct _microlite_interpreter_obj_t {
5656
mp_obj_array_t *tensor_arena;
5757
mp_obj_t tf_interpreter;
5858
mp_obj_t tf_model;
59-
mp_obj_t tf_error_reporter;
6059
int16_t inference_count;
6160
mp_obj_t input_callback;
6261
mp_obj_t output_callback;

0 commit comments

Comments
 (0)