diff options
Diffstat (limited to 'source/application/tensorflow-lite-micro')
3 files changed, 15 insertions, 11 deletions
diff --git a/source/application/tensorflow-lite-micro/Model.cc b/source/application/tensorflow-lite-micro/Model.cc index e9c6cd3..80ef3c3 100644 --- a/source/application/tensorflow-lite-micro/Model.cc +++ b/source/application/tensorflow-lite-micro/Model.cc @@ -196,14 +196,22 @@ void arm::app::Model::LogInterpreterInfo() info("Activation buffer (a.k.a tensor arena) size used: %zu\n", this->m_pInterpreter->arena_used_bytes()); - const size_t nOperators = this->m_pInterpreter->operators_size(); - info("Number of operators: %zu\n", nOperators); + /* We expect there to be only one subgraph. */ + const uint32_t nOperators = tflite::NumSubgraphOperators(this->m_pModel, 0); + info("Number of operators: %" PRIu32 "\n", nOperators); - /* For each operator, display registration information */ + const tflite::SubGraph* subgraph = this->m_pModel->subgraphs()->Get(0); + + auto* opcodes = this->m_pModel->operator_codes(); + + /* For each operator, display registration information. */ for (size_t i = 0 ; i < nOperators; ++i) { - const tflite::NodeAndRegistration nodeReg = - this->m_pInterpreter->node_and_registration(i); - const TfLiteRegistration* reg = nodeReg.registration; + const tflite::Operator* op = subgraph->operators()->Get(i); + const tflite::OperatorCode* opcode = opcodes->Get(op->opcode_index()); + const TfLiteRegistration* reg = nullptr; + + tflite::GetRegistrationFromOpCode(opcode, this->GetOpResolver(), + this->m_pErrorReporter, ®); std::string opName{""}; if (reg) { diff --git a/source/application/tensorflow-lite-micro/TensorFlowLiteMicro.cc b/source/application/tensorflow-lite-micro/TensorFlowLiteMicro.cc index ce36a8f..0b08513 100644 --- a/source/application/tensorflow-lite-micro/TensorFlowLiteMicro.cc +++ b/source/application/tensorflow-lite-micro/TensorFlowLiteMicro.cc @@ -19,10 +19,7 @@ #include "hal.h" void PrintTensorFlowVersion() -{ - info("uTFL version: %u.%u.%u\n", TF_MAJOR_VERSION, TF_MINOR_VERSION, - TF_PATCH_VERSION); -} +{} arm::app::QuantParams arm::app::GetTensorQuantParams(TfLiteTensor* tensor) { diff --git a/source/application/tensorflow-lite-micro/include/TensorFlowLiteMicro.hpp b/source/application/tensorflow-lite-micro/include/TensorFlowLiteMicro.hpp index 677b4ba..1333f6c 100644 --- a/source/application/tensorflow-lite-micro/include/TensorFlowLiteMicro.hpp +++ b/source/application/tensorflow-lite-micro/include/TensorFlowLiteMicro.hpp @@ -51,7 +51,6 @@ #include "tensorflow/lite/c/common.h" #include "tensorflow/lite/micro/kernels/micro_ops.h" #include "tensorflow/lite/schema/schema_generated.h" -#include "tensorflow/lite/version.h" #if defined (TESTS) #include "tensorflow/lite/micro/test_helpers.h" |