Stop profiling if inference failed 82/248282/1 submit/tizen/20201125.055433
authorInki Dae <inki.dae@samsung.com>
Wed, 25 Nov 2020 05:27:00 +0000 (14:27 +0900)
committerInki Dae <inki.dae@samsung.com>
Wed, 25 Nov 2020 05:27:00 +0000 (14:27 +0900)
Change-Id: I4ed0f45e7f34677470f81c2161370ff89d15f467
Signed-off-by: Inki Dae <inki.dae@samsung.com>
src/inference_engine_common_impl.cpp

index 8003165..d4d903b 100644 (file)
@@ -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");