diff --git a/tf_adapter_2.x/npu_device/core/npu_device.cpp b/tf_adapter_2.x/npu_device/core/npu_device.cpp index ca7c5e425761573098912a7fbfdc950d66eeea9a..cac2af25c51ba2a46be9a6f725a288a20ad39c8d 100644 --- a/tf_adapter_2.x/npu_device/core/npu_device.cpp +++ b/tf_adapter_2.x/npu_device/core/npu_device.cpp @@ -1032,6 +1032,7 @@ tensorflow::Status NpuDevice::TransTfGraph2GeGraph(TFE_Context *context, const s std::map const_value_map; std::vector partition_graph; NPU_REQUIRES_OK(SeparateGraphDef(const_cast(&def), partition_graph, const_value_map)); + LOG(ERROR) << "Size: " << partition_graph.size() << "IsEmpty: " << partition_graph.front().GetLength(); NPU_REQUIRES(parser->ParseProtoWithSubgraph(partition_graph, const_value_map, request_subgraph, ge_compute_graph) == ge::SUCCESS, tensorflow::errors::Internal("NPU Parse tensorflow model failed")); diff --git a/tf_adapter_2.x/npu_device/core/npu_utils.cpp b/tf_adapter_2.x/npu_device/core/npu_utils.cpp index e005c5599466494086061a95d2d68bee59572631..7e7e0c4a2eb1cb3f9299eb63c21ea5cfa1e667d4 100644 --- a/tf_adapter_2.x/npu_device/core/npu_utils.cpp +++ b/tf_adapter_2.x/npu_device/core/npu_utils.cpp @@ -512,8 +512,10 @@ void NpuCustomizedOptimizeGraph(tensorflow::FunctionLibraryRuntime &lib, std::un tensorflow::Status SeparateGraphDef(tensorflow::GraphDef *def, std::vector &partition_graph, std::map &const_value_map) { + LOG(ERROR) << "Enter SeparateGraphDef"; std::string def_str = def->SerializeAsString(); if (!def_str.empty()) { + LOG(ERROR) << "def_str is not empty" << def_str.length(); partition_graph.push_back(ge::AscendString(def_str.c_str(), def_str.length())); return tensorflow::Status::OK(); } @@ -533,8 +535,9 @@ tensorflow::Status SeparateGraphDef(tensorflow::GraphDef *def, ge::AscendString(tensor_str.c_str(), tensor_str.length())}); node.mutable_attr()->erase(iter); } - } + } def_str = def->SerializeAsString(); + LOG(ERROR) << "def_str : " << def_str.length(); partition_graph.push_back(ge::AscendString(def_str.c_str(), def_str.length())); return tensorflow::Status::OK(); }