[nnkit-tf] Throw T/F error message (#8673)
author박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 1 Nov 2019 03:03:38 +0000 (12:03 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 1 Nov 2019 03:03:38 +0000 (12:03 +0900)
The exception thrown inside run method now contains detailed message
that comes from TensorFlow itself.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
compiler/nnkit-tf/support/src/Runner.cpp

index e3b0ada..a944c4a 100644 (file)
@@ -225,7 +225,7 @@ void Runner::run()
   TF_DeleteSessionOptions(options);
 
   if (TF_GetCode(_status) != TF_OK)
-    throw std::runtime_error("Error while creating a new session");
+    throw std::runtime_error(TF_Message(_status));
 
   TF_SessionRun(_sess,
                 nullptr, // Run options.
@@ -237,7 +237,7 @@ void Runner::run()
                 );
 
   if (TF_GetCode(_status) != TF_OK)
-    throw std::runtime_error("Error while running a session");
+    throw std::runtime_error(TF_Message(_status));
 
   TF_CloseSession(_sess, _status);
   TF_DeleteSession(_sess, _status);