forked from huawei/mindspore2022
fix load fail log
Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
parent
21c11c1189
commit
b9a7af7b05
|
|
@ -33,15 +33,23 @@ Status AclModel::Build() {
|
|||
return kSuccess;
|
||||
}
|
||||
|
||||
std::shared_ptr<AclModelOptions> options = std::make_shared<AclModelOptions>(model_context_);
|
||||
MS_EXCEPTION_IF_NULL(options);
|
||||
|
||||
if (graph_cell_ == nullptr && graph_->ModelType() == ModelType::kOM) {
|
||||
MS_LOG(INFO) << "Note: Load om model and all build options will be ignored.";
|
||||
MS_LOG(INFO) << "Load om model and all build options will be ignored.";
|
||||
graph_cell_ = std::make_shared<GraphCell>(graph_);
|
||||
MS_EXCEPTION_IF_NULL(graph_cell_);
|
||||
auto ret = graph_cell_->Load(options->GetDeviceID());
|
||||
if (ret != kSuccess) {
|
||||
MS_LOG(ERROR) << "Load failed.";
|
||||
return ret;
|
||||
}
|
||||
|
||||
options_ = std::move(options);
|
||||
return kSuccess;
|
||||
}
|
||||
|
||||
std::shared_ptr<AclModelOptions> options = std::make_shared<AclModelOptions>(model_context_);
|
||||
MS_EXCEPTION_IF_NULL(options);
|
||||
std::string options_key = options->GenAclOptionsKey();
|
||||
std::shared_ptr<Graph> graph;
|
||||
if (auto iter = dynamic_size_graph_map_.find(options_key); iter != dynamic_size_graph_map_.end()) {
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ Status Serialization::Load(const std::vector<char> &file, ModelType model_type,
|
|||
false);
|
||||
anf_graph = mindir_loader.LoadMindIR(file_path);
|
||||
if (anf_graph == nullptr) {
|
||||
err_msg << "Load model failed. Please check the valid of dec_key and dec_mode";
|
||||
err_msg << "Load model failed.";
|
||||
MS_LOG(ERROR) << err_msg.str();
|
||||
return Status(kMEInvalidInput, err_msg.str());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue