diff options
author | Richard Burton <richard.burton@arm.com> | 2021-08-12 17:26:30 +0100 |
---|---|---|
committer | Richard Burton <richard.burton@arm.com> | 2021-08-12 17:26:30 +0100 |
commit | 0d110594b8a50ce3311be5187f01de2e3b8fe995 (patch) | |
tree | 1e56414f491f1bbd29df4912e2354ac5e1682133 /source/application/tensorflow-lite-micro/Model.cc | |
parent | d2b9853ca848f11dee55beedbb9d650763b3ed53 (diff) | |
download | ml-embedded-evaluation-kit-0d110594b8a50ce3311be5187f01de2e3b8fe995.tar.gz |
MLECO-1904: Update to use latest TFLu
* Now uses seperate TFLu github repo
* Fixes to align with API changes
* Update ASR model ops and re-enable ASR inference tests
* Set default release level to release_with_logs
Signed-off-by: Richard Burton <richard.burton@arm.com>
Change-Id: I57612088985dece1413c5c00a6e442381e07dd91
Diffstat (limited to 'source/application/tensorflow-lite-micro/Model.cc')
-rw-r--r-- | source/application/tensorflow-lite-micro/Model.cc | 20 |
1 files changed, 14 insertions, 6 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) { |