|
|
|
@@ -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; |
|
|
|
} |
|
|
|
|