From 9e26b8559e06d08ae2f5d9c9f62dd3555bf3b379 Mon Sep 17 00:00:00 2001 From: Hyoung Joo Ahn Date: Fri, 25 Jan 2019 16:26:13 +0900 Subject: [PATCH] [Filter/NNFW] add error message for user&debugging add error message when errors have occurred Signed-off-by: Hyoung Joo Ahn --- gst/nnstreamer/tensor_filter/tensor_filter_tensorflow.c | 5 ++++- gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c | 5 ++++- gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow.c b/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow.c index 1c4ac3e..25fe4b9 100644 --- a/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow.c +++ b/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow.c @@ -81,10 +81,13 @@ tf_loadModelFile (const GstTensorFilter * filter, void **private_data) *private_data = tf; tf->tf_private_data = tf_core_new (filter->prop.model_file); if (tf->tf_private_data) { - if (tf_core_init (tf->tf_private_data, &filter->prop)) + if (tf_core_init (tf->tf_private_data, &filter->prop)) { + GST_ERROR ("failed to initailize the object: tensorflow"); return -2; + } return 0; } else { + GST_ERROR ("failed to create the object: tensorflow"); return -1; } } diff --git a/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c b/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c index 7e3fb9e..9dffa89 100644 --- a/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c +++ b/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c @@ -81,10 +81,13 @@ tflite_loadModelFile (const GstTensorFilter * filter, void **private_data) *private_data = tf; tf->tflite_private_data = tflite_core_new (filter->prop.model_file); if (tf->tflite_private_data) { - if (tflite_core_init (tf->tflite_private_data)) + if (tflite_core_init (tf->tflite_private_data)) { + GST_ERROR ("failed to initialize the object: Tensorflow-lite"); return -2; + } return 0; } else { + GST_ERROR ("failed to create the object: Tensorflow-lite"); return -1; } } diff --git a/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc b/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc index 3208433..69a5f75 100644 --- a/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc +++ b/gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc @@ -187,6 +187,7 @@ TFLiteCore::setInputTensorProp () for (int i = 0; i < inputTensorMeta.num_tensors; ++i) { if (getTensorDim (input_idx_list[i], inputTensorMeta.info[i].dimension)) { + GST_ERROR ("failed to get the dimension of input tensors"); return -1; } inputTensorMeta.info[i].type = @@ -215,6 +216,7 @@ TFLiteCore::setOutputTensorProp () for (int i = 0; i < outputTensorMeta.num_tensors; ++i) { if (getTensorDim (output_idx_list[i], outputTensorMeta.info[i].dimension)) { + GST_ERROR ("failed to get the dimension of output tensors"); return -1; } outputTensorMeta.info[i].type = -- 2.7.4