Browse Source

bugfix for onnx data index seting

pull/245/head
y00500818 4 years ago
parent
commit
a3b08a88c2
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      parser/onnx/onnx_parser.cc

+ 2
- 1
parser/onnx/onnx_parser.cc View File

@@ -159,6 +159,7 @@ Status OnnxModelParser::ParseInput(ge::onnx::GraphProto &onnx_graph,
}

// get input value info map
int64_t data_index = 0;
for (int i = 0; i < onnx_graph.input_size(); i++) {
ge::onnx::ValueInfoProto value_info = onnx_graph.input(i);
GELOGI("The index of %d input name : %s.", i, value_info.name().c_str());
@@ -201,7 +202,7 @@ Status OnnxModelParser::ParseInput(ge::onnx::GraphProto &onnx_graph,
// add index
ge::onnx::AttributeProto *attribute_index = input_node->add_attribute();
attribute_index->set_name(ge::kAttrNameIndex);
attribute_index->set_i(i);
attribute_index->set_i(data_index++);
input_node_names_.emplace_back(value_info.name());
}
return SUCCESS;


Loading…
Cancel
Save