From 1718117cb4f2df7a20add6c0e8031c16ab0fe534 Mon Sep 17 00:00:00 2001 From: lichun Date: Tue, 15 Dec 2020 10:12:35 +0800 Subject: [PATCH] load om through LoadRootModel --- ge/graph/load/new_model_manager/model_manager.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ge/graph/load/new_model_manager/model_manager.cc b/ge/graph/load/new_model_manager/model_manager.cc index b595ac39..d19ca643 100755 --- a/ge/graph/load/new_model_manager/model_manager.cc +++ b/ge/graph/load/new_model_manager/model_manager.cc @@ -1055,7 +1055,16 @@ Status ModelManager::LoadModelOffline(uint32_t &model_id, const ModelData &model mmTimespec timespec = mmGetTickCount(); ModelHelper model_helper; - Status ret = model_helper.LoadModel(model); + Status ret = model_helper.LoadRootModel(model); + if (model_helper.GetModelType()) { + bool is_shape_unknown = false; + GE_CHK_STATUS_RET(model_helper.GetGeRootModel()->CheckIsUnknownShape(is_shape_unknown), + "CheckIsUnknownShape failed, model id:%u", + model_id); + if (is_shape_unknown || GetContext().GetHostExecFlag()) { + return DoLoadHybridModelOnline(model_id, model_helper.GetGeRootModel(), listener); + } + } if (ret != SUCCESS) { GELOGE(ret, "load model failed."); return ret;