Browse Source

!1249 fix bug that all subgraph is unknown and netoutput format is not nd bug

From: @wan_xuelei
Reviewed-by: @xchu42,@xchu42,@wqtshg
Signed-off-by: @wqtshg
tags/v1.2.0
mindspore-ci-bot Gitee 3 years ago
parent
commit
7f94f51ef2
2 changed files with 5 additions and 3 deletions
  1. +3
    -3
      ge/graph/load/model_manager/model_manager.cc
  2. +2
    -0
      ge/graph/passes/net_output_pass.cc

+ 3
- 3
ge/graph/load/model_manager/model_manager.cc View File

@@ -297,10 +297,11 @@ Status ModelManager::LoadModelOnline(uint32_t &model_id, const shared_ptr<ge::Ge
if (model_id == INVALID_MODEL_ID) {
GenModelId(&model_id);
}
auto name_to_model = ge_root_model->GetSubgraphInstanceNameToModel();
string model_name = "";
bool is_shape_unknown = ge_root_model->GetRootGraph()->GetGraphUnknownFlag();
if (is_shape_unknown || GetContext().GetHostExecFlag()) {
// if multi subgraph is known, do hybrid load process
if (is_shape_unknown || GetContext().GetHostExecFlag() || (name_to_model.size() > 1)) {
return DoLoadHybridModelOnline(model_id, model_name, ge_root_model, listener);
}

@@ -322,7 +323,6 @@ Status ModelManager::LoadModelOnline(uint32_t &model_id, const shared_ptr<ge::Ge
auto root_graph = ge_root_model->GetRootGraph();
GE_CHECK_NOTNULL(root_graph);
string root_model_name = root_graph->GetName();
auto name_to_model = ge_root_model->GetSubgraphInstanceNameToModel();
GeModelPtr ge_model = name_to_model[root_model_name];
Status ret = SUCCESS;
do {


+ 2
- 0
ge/graph/passes/net_output_pass.cc View File

@@ -555,6 +555,8 @@ void NetOutputPass::AddInOutForNetOutputOp(const ComputeGraphPtr &graph, OpDescP
return;
}
ge::GeTensorDesc out_desc = src_node->GetOpDesc()->GetOutputDesc(src_index);
out_desc.SetFormat(FORMAT_ND);
out_desc.SetOriginFormat(FORMAT_ND);
GE_IF_BOOL_EXEC(net_output_desc->AddInputDesc(out_desc) != SUCCESS, GELOGW("add input desc failed"); return );
is_input_const.push_back(PassUtils::IsConstant(src_node));
++iter;


Loading…
Cancel
Save