Browse Source

bug

pull/1102/head
wjm 5 years ago
parent
commit
6608471b51
2 changed files with 5 additions and 5 deletions
  1. +4
    -5
      ge/common/helper/model_helper.cc
  2. +1
    -0
      inc/framework/omg/model_tool.h

+ 4
- 5
ge/common/helper/model_helper.cc View File

@@ -900,7 +900,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelTool::GetModelInfoF
ge::ModelData model;
int32_t priority = 0;

// Load model from file
Status ret = ModelParserBase::LoadFromFile(model_file, "", priority, model);
if (ret != SUCCESS) {
GELOGE(ret, "LoadFromFile failed.");
@@ -915,7 +914,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelTool::GetModelInfoF

uint8_t *model_data = nullptr;
uint32_t model_len = 0;
// Parse the contents of the file to get the modeldef object
ret = ModelParserBase::ParseModelContent(model, model_data, model_len);
if (ret != SUCCESS) {
ErrorManager::GetInstance().ATCReportErrMessage("E10003",
@@ -943,7 +942,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelTool::GetModelInfoF
}

bool flag = ReadProtoFromArray(ir_part.data, ir_part.size, &model_def);
if (flag) {
if (!flag) {
ret = INTERNAL_ERROR;
ErrorManager::GetInstance().ATCReportErrMessage("E19021", {"reason"}, {"ReadProtoFromArray failed"});
GELOGE(ret, "ReadProtoFromArray failed.");
@@ -957,7 +956,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelTool::GetModelInfoF
GE_CHECK_NOTNULL(model_file);
ge::ModelData model;
int32_t priority = 0;
// Load model from file
Status ret = ModelParserBase::LoadFromFile(model_file, "", priority, model);
auto free_model_data = [](void **ptr) -> void {
if (ptr != nullptr && *ptr != nullptr) {
@@ -984,7 +983,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelTool::GetModelInfoF
} catch (google::protobuf::FatalException &e) {
free_model_data(&model.model_data);
ErrorManager::GetInstance().ATCReportErrMessage("E19021", {"reason"}, {"ParseFromString failed, exception message["
+ std::string(e.what()) + "]"});
+ std::string(e.what()) + "]"});
GELOGE(FAILED, "ParseFromString failed. exception message : %s", e.what());
return FAILED;
}


+ 1
- 0
inc/framework/omg/model_tool.h View File

@@ -31,4 +31,5 @@ class GE_FUNC_VISIBILITY ModelTool {
static Status GetModelInfoFromPbtxt(const char *model_file, ge::proto::ModelDef &model_def);
};
} // namespace ge

#endif // INC_FRAMEWORK_OMG_MODEL_TOOL_H_

Loading…
Cancel
Save