[moco-tf] Fix for ui_0004 seg-fault (#9185)
author박세희/On-Device Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 26 Nov 2019 03:19:17 +0000 (12:19 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 26 Nov 2019 03:19:17 +0000 (12:19 +0900)
This will handle invalid info file error as oops::UserExn

Signed-off-by: SaeHie Park <saehie.park@samsung.com>
compiler/moco-tf/src/Frontend.cpp

index a446bff..8ffb588 100644 (file)
@@ -136,6 +136,10 @@ void set_input_shape(const moco::ModelSignature &signature, tensorflow::GraphDef
 
     auto node_shape = n.mutable_attr()->at("shape").mutable_shape();
     auto sig_shape = signature.shape(n.name() + ":0");
+    if (sig_shape == nullptr)
+    {
+      throw oops::UserExn("Please check model info file. Node not found in model file", n.name());
+    }
     if (node_shape->unknown_rank() || !node_shape->dim_size())
     {
       node_shape->clear_unknown_rank();