| @@ -1439,7 +1439,7 @@ Status CaffeModelParser::Parse(const char *model_path, ge::ComputeGraphPtr &grap | |||||
| bool has_error = false; | bool has_error = false; | ||||
| GE_CHECK_NOTNULL(model_path); | GE_CHECK_NOTNULL(model_path); | ||||
| GE_CHECK_NOTNULL(graph); | GE_CHECK_NOTNULL(graph); | ||||
| GELOGI("Caffe Parse model file %s", model_path); | |||||
| GELOGI("Caffe Parse model file [%s]", model_path); | |||||
| PreChecker::Instance().Clear(); | PreChecker::Instance().Clear(); | ||||
| @@ -99,7 +99,7 @@ Status PreChecker::CheckName(OpId id) { | |||||
| if (id != v.first && info.name == v.second.name) { | if (id != v.first && info.name == v.second.name) { | ||||
| Cause cause; | Cause cause; | ||||
| cause.code = ErrorCode::NAME_REPEATED; | cause.code = ErrorCode::NAME_REPEATED; | ||||
| cause.message = "The name is repeated."; | |||||
| cause.message = "The name is repeated in the graph."; | |||||
| GELOGE(FAILED, "opname %s repeated, same name op in the graph", info.name.c_str()); | GELOGE(FAILED, "opname %s repeated, same name op in the graph", info.name.c_str()); | ||||
| ErrorManager::GetInstance().ATCReportErrMessage("E19009", {"opname"}, {info.name}); | ErrorManager::GetInstance().ATCReportErrMessage("E19009", {"opname"}, {info.name}); | ||||
| @@ -250,11 +250,9 @@ Status PreChecker::CheckTypeSupported(OpId id, const string &type, const string | |||||
| Cause cause; | Cause cause; | ||||
| cause.code = ErrorCode::TYPE_UNSUPPORTED; | cause.code = ErrorCode::TYPE_UNSUPPORTED; | ||||
| cause.message = "The type is not supported."; | cause.message = "The type is not supported."; | ||||
| GELOGI("Check op[%s]'s type[%s] is not supported.", name.c_str(), type.c_str()); | |||||
| if (!is_tensorflow) { | if (!is_tensorflow) { | ||||
| ErrorManager::GetInstance().ATCReportErrMessage("E19010", {"opname", "optype"}, {name, type}); | ErrorManager::GetInstance().ATCReportErrMessage("E19010", {"opname", "optype"}, {name, type}); | ||||
| GELOGE(FAILED, "Check op[%s]'s type[%s] failed, it is not supported.", name.c_str(), type.c_str()); | |||||
| } else { | |||||
| GELOGI("Check op[%s]'s type[%s] is not supported.", name.c_str(), type.c_str()); | |||||
| } | } | ||||
| GE_RETURN_WITH_LOG_IF_ERROR(AddCause(id, cause), "[Add][Cause] failed."); | GE_RETURN_WITH_LOG_IF_ERROR(AddCause(id, cause), "[Add][Cause] failed."); | ||||
| } | } | ||||
| @@ -36,6 +36,7 @@ | |||||
| #include "parser/caffe/caffe_op_parser.h" | #include "parser/caffe/caffe_op_parser.h" | ||||
| #include "graph/operator_reg.h" | #include "graph/operator_reg.h" | ||||
| #include "parser/common/acl_graph_parser_util.h" | #include "parser/common/acl_graph_parser_util.h" | ||||
| #include "common/op_map.h" | |||||
| #undef protected | #undef protected | ||||
| #undef private | #undef private | ||||
| @@ -223,6 +224,10 @@ TEST_F(STestCaffeParser, acl_caffe_parser) { | |||||
| EXPECT_EQ(ret, GRAPH_FAILED); | EXPECT_EQ(ret, GRAPH_FAILED); | ||||
| ret = ge::aclgrphParseCaffe(model_file.c_str(), weight_file.c_str(), graph); | ret = ge::aclgrphParseCaffe(model_file.c_str(), weight_file.c_str(), graph); | ||||
| EXPECT_EQ(ret, GRAPH_FAILED); | EXPECT_EQ(ret, GRAPH_FAILED); | ||||
| caffe_op_map.clear(); | |||||
| ret = ge::aclgrphParseCaffe(model_file.c_str(), weight_file.c_str(), parser_params, graph); | |||||
| EXPECT_EQ(ret, GRAPH_FAILED); | |||||
| } | } | ||||
| TEST_F(STestCaffeParser, modelparser_parsefrommemory_success) | TEST_F(STestCaffeParser, modelparser_parsefrommemory_success) | ||||
| @@ -2832,6 +2832,15 @@ TEST_F(STestTensorflowParser, tensorflow_AddControlEdgeAfterRemoveInputs_test) | |||||
| removed_inputs_vec.emplace_back("Add0"); | removed_inputs_vec.emplace_back("Add0"); | ||||
| Status ret = tensorflow_parser.AddControlEdgeAfterRemoveInputs(&graph_def, node_def, all_node_map, removed_inputs_vec); | Status ret = tensorflow_parser.AddControlEdgeAfterRemoveInputs(&graph_def, node_def, all_node_map, removed_inputs_vec); | ||||
| EXPECT_EQ(ret, SUCCESS); | EXPECT_EQ(ret, SUCCESS); | ||||
| tensorflow::NodeDef *node_swith = initNodeDef(); | |||||
| node_swith->set_name("switch_op"); | |||||
| node_swith->set_op(parser::SWITCH); | |||||
| all_node_map.emplace("switch_op", node_swith); | |||||
| removed_inputs_vec.clear(); | |||||
| removed_inputs_vec.emplace_back("switch_op"); | |||||
| ret = tensorflow_parser.AddControlEdgeAfterRemoveInputs(&graph_def, node_swith, all_node_map, removed_inputs_vec); | |||||
| EXPECT_EQ(ret, SUCCESS); | |||||
| } | } | ||||
| TEST_F(STestTensorflowParser, tensorflow_GraphDefOptimizeIdentity_test) | TEST_F(STestTensorflowParser, tensorflow_GraphDefOptimizeIdentity_test) | ||||
| @@ -39,6 +39,7 @@ | |||||
| #include "graph/operator_reg.h" | #include "graph/operator_reg.h" | ||||
| #include "parser/common/acl_graph_parser_util.h" | #include "parser/common/acl_graph_parser_util.h" | ||||
| #include "parser/caffe/caffe_reshape_parser.h" | #include "parser/caffe/caffe_reshape_parser.h" | ||||
| #include "common/op_map.h" | |||||
| #undef protected | #undef protected | ||||
| #undef private | #undef private | ||||
| @@ -266,6 +267,10 @@ TEST_F(UtestCaffeParser, acl_caffe_parser) { | |||||
| EXPECT_EQ(ret, GRAPH_FAILED); | EXPECT_EQ(ret, GRAPH_FAILED); | ||||
| ret = ge::aclgrphParseCaffe(model_file.c_str(), weight_file.c_str(), graph); | ret = ge::aclgrphParseCaffe(model_file.c_str(), weight_file.c_str(), graph); | ||||
| EXPECT_EQ(ret, GRAPH_FAILED); | EXPECT_EQ(ret, GRAPH_FAILED); | ||||
| caffe_op_map.clear(); | |||||
| ret = ge::aclgrphParseCaffe(model_file.c_str(), weight_file.c_str(), parser_params, graph); | |||||
| EXPECT_EQ(ret, GRAPH_FAILED); | |||||
| } | } | ||||
| TEST_F(UtestCaffeParser, ParseFromMemory_success) | TEST_F(UtestCaffeParser, ParseFromMemory_success) | ||||
| @@ -34,6 +34,7 @@ | |||||
| #include "parser/common/pass_manager.h" | #include "parser/common/pass_manager.h" | ||||
| #include "parser/common/tbe_plugin_loader.h" | #include "parser/common/tbe_plugin_loader.h" | ||||
| #include "parser/common/parser_fp16_t.h" | #include "parser/common/parser_fp16_t.h" | ||||
| #include "parser/common/pre_checker.h" | |||||
| #undef protected | #undef protected | ||||
| #undef private | #undef private | ||||
| @@ -342,4 +343,15 @@ TEST_F(UtestAclGraphParser, test_operatoreq) | |||||
| int8 = fp16; | int8 = fp16; | ||||
| } | } | ||||
| TEST_F(UtestAclGraphParser, test_pre_checker) { | |||||
| PreChecker::Instance().fmk_op_types_ = nullptr; | |||||
| const char* str = "iiii"; | |||||
| PreChecker::OpId id = str; | |||||
| std::string type("ddd"); | |||||
| std::string name("lll"); | |||||
| Status ret = PreChecker::Instance().CheckTypeSupported(id, type, name, false); | |||||
| EXPECT_EQ(ret, FAILED); | |||||
| ret = PreChecker::Instance().CheckTypeSupported(id, type, name, true); | |||||
| EXPECT_EQ(ret, FAILED); | |||||
| } | |||||
| } // namespace ge | } // namespace ge | ||||