Tensorflow warning: The graph couldn't be sorted in topological order?

后端 未结 2 902
萌比男神i
萌比男神i 2021-01-04 06:00

When I run tensorflow training (with custom defined graph, closed source), it outputs the warning:

2018-10-03 14:29:24.352895: E tensorfl

2条回答
  •  甜味超标
    2021-01-04 06:48

    A topological ordering of a directed graph is an ordering of its vertices in such a way that whenever there is an edge from vertex u to vertex v, vertex u comes before vertex v in the ordering.

    This kind of ordering is possible for every directed acyclic graph but not for arbitrary graphs. There is most likely some kind of cycle in your graph that prevents the sorting algorithm from succeeding. So, the way to go is searching for the cycle and removing it in some way.

    As an example, consider a very small graph with two vertices, u and v, and two edges, u -> v and v -> u. There is no way to sort u and v in accordance with the requirements given above.

    Without further information on your code it is hard to say exactly what is going on.

提交回复
热议问题