From 7dbaaa57148c061396c241911936d2e40fd68b7a Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Fri, 5 Aug 2022 13:57:04 +0100 Subject: IVGCVSW-7179 Segfault running ssd_mobilenet_v2_int8 with ExNet and delegate. * model was declared in the TfLiteExecutor constructor, instead of intializing m_Model * Working with this model that has 4 output we saw the the output names were not correct, this got fixed too Signed-off-by: Teresa Charlin Change-Id: I48f194ad4ba6af43d43e6eea336eb87ffee02dcc --- tests/ExecuteNetwork/TfliteExecutor.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/ExecuteNetwork/TfliteExecutor.cpp b/tests/ExecuteNetwork/TfliteExecutor.cpp index 59c69f9d6a..d750fcccc7 100644 --- a/tests/ExecuteNetwork/TfliteExecutor.cpp +++ b/tests/ExecuteNetwork/TfliteExecutor.cpp @@ -7,13 +7,12 @@ TfLiteExecutor::TfLiteExecutor(const ExecuteNetworkParams& params) : m_Params(params) { - std::unique_ptr model = - tflite::FlatBufferModel::BuildFromFile(m_Params.m_ModelPath.c_str()); + m_Model = tflite::FlatBufferModel::BuildFromFile(m_Params.m_ModelPath.c_str()); m_TfLiteInterpreter = std::make_unique(); tflite::ops::builtin::BuiltinOpResolver resolver; - tflite::InterpreterBuilder builder(*model, resolver); + tflite::InterpreterBuilder builder(*m_Model, resolver); builder(&m_TfLiteInterpreter); m_TfLiteInterpreter->AllocateTensors(); @@ -144,7 +143,7 @@ std::vector TfLiteExecutor::Execute() outputSize *= outputDims->data[dim]; } - std::cout << m_Params.m_OutputNames[outputIndex] << ": "; + std::cout << m_TfLiteInterpreter->tensor(tfLiteDelegateOutputId)->name << ": "; results.push_back(m_TfLiteInterpreter->tensor(tfLiteDelegateOutputId)->allocation); switch (m_TfLiteInterpreter->tensor(tfLiteDelegateOutputId)->type) -- cgit v1.2.1