[Filters] Emit more friendly error messages.
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 14 Jun 2019 02:16:54 +0000 (11:16 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 17 Jun 2019 04:53:53 +0000 (13:53 +0900)
When they cannot load a model file due to file types,
don't just tell you cannot load it.
Tell more about it along with the file path.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
ext/nnstreamer/tensor_filter/tensor_filter_pytorch_core.cc
ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_core.cc
ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite_core.cc

index aba804c..d2b0c7d 100644 (file)
@@ -105,7 +105,7 @@ TorchCore::loadModel ()
 #endif
 
   if (!g_file_test (model_path, G_FILE_TEST_IS_REGULAR)) {
-    g_critical ("the file of model_path is not valid.");
+    g_critical ("the file of model_path (%s) is not valid (not regular).", model_path);
     return -1;
   }
 
index 6fb1f11..877b7dc 100644 (file)
@@ -108,7 +108,7 @@ TFCore::loadModel ()
   GraphDef graph_def;
 
   if (!g_file_test (model_path, G_FILE_TEST_IS_REGULAR)) {
-    g_critical ("the file of model_path is not valid\n");
+    g_critical ("the file of model_path (%s) is not valid (not regular)\n", model_path);
     return -1;
   }
   status = ReadBinaryProto (Env::Default (), model_path, &graph_def);
index beaf2f6..46291b1 100644 (file)
@@ -109,7 +109,7 @@ TFLiteCore::loadModel ()
 
   if (!interpreter) {
     if (!g_file_test (model_path, G_FILE_TEST_IS_REGULAR)) {
-      g_critical ("the file of model_path is not valid\n");
+      g_critical ("the file of model_path (%s) is not valid (not regular)\n", model_path);
       return -1;
     }
     model =