diff --git a/mindspore/core/ir/graph_utils.cc b/mindspore/core/ir/graph_utils.cc index 6d7e251dc1..fb61a1db40 100644 --- a/mindspore/core/ir/graph_utils.cc +++ b/mindspore/core/ir/graph_utils.cc @@ -77,12 +77,12 @@ std::vector TopoSort(const AnfNodePtr &root, const SuccFunc &succ, c auto circle_node_it = std::find(todo.begin(), todo.end(), next); for (; circle_node_it != todo.end(); circle_node_it++) { auto circle_node = *circle_node_it; - if (circle_node->seen_) { + if (circle_node->seen_ == seen) { MS_LOG(ERROR) << "#" << pos << ": " << circle_node->DebugString(); pos++; } } - MS_LOG(EXCEPTION) << "Graph cycle exists, node " << next->DebugString(2); + MS_LOG(EXCEPTION) << "Graph cycle exists, strike node: " << next->DebugString(2); }); } else if (incl > EXCLUDE) { // Not NOFOLLOW or EXCLUDE MS_LOG(EXCEPTION) << "The result of include(node) must be one of: \"follow\", \"nofollow\", \"exclude\"";