[Filter/NNFW] add error message for user&debugging
authorHyoung Joo Ahn <hello.ahn@samsung.com>
Fri, 25 Jan 2019 07:26:13 +0000 (16:26 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Fri, 25 Jan 2019 09:34:30 +0000 (18:34 +0900)
add error message when errors have occurred

Signed-off-by: Hyoung Joo Ahn <hello.ahn@samsung.com>
gst/nnstreamer/tensor_filter/tensor_filter_tensorflow.c
gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c
gst/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc

index 1c4ac3e..25fe4b9 100644 (file)
@@ -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;
   }
 }
index 7e3fb9e..9dffa89 100644 (file)
@@ -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;
   }
 }
index 3208433..69a5f75 100644 (file)
@@ -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 =