From 292368ea8ab35b097ea952ee73959d108651a69a Mon Sep 17 00:00:00 2001 From: Inki Dae Date: Wed, 25 Nov 2020 14:27:00 +0900 Subject: [PATCH] Stop profiling if inference failed Change-Id: I4ed0f45e7f34677470f81c2161370ff89d15f467 Signed-off-by: Inki Dae --- src/inference_engine_common_impl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/inference_engine_common_impl.cpp b/src/inference_engine_common_impl.cpp index 8003165..d4d903b 100644 --- a/src/inference_engine_common_impl.cpp +++ b/src/inference_engine_common_impl.cpp @@ -455,8 +455,10 @@ out: } int ret = mBackendHandle->Load(model_paths, model_format); - if (ret != INFERENCE_ENGINE_ERROR_NONE) + if (ret != INFERENCE_ENGINE_ERROR_NONE) { LOGE("Fail to load InferenceEngineVision"); + mUseProfiler = false; + } if (mUseProfiler == true) { mProfiler->Stop(IE_PROFILER_LATENCY, "Load"); @@ -613,6 +615,10 @@ out: } int ret = mBackendHandle->Run(input_buffers, output_buffers); + if (ret != INFERENCE_ENGINE_ERROR_NONE) { + LOGE("Failed to inference."); + mUseProfiler = false; + } if (mUseProfiler == true) { mProfiler->Stop(IE_PROFILER_LATENCY, "Run"); -- 2.34.1