Skip to content

Commit 6ae0838

Browse files
authored
[Bug] Fix export graph bug in windows (#1244)
* fix export graph bug in windows * fix format
1 parent d66066b commit 6ae0838

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

visualdl/component/graph/graph_component.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# =======================================================================
1515
import collections
1616
import os.path
17+
import pathlib
1718
import re
1819

1920
_graph_version = '1.0.0'
@@ -108,6 +109,8 @@ def _construct_edge(src_node, dst_node):
108109
all_edges[(src_node, dst_node)]['vars'].add(var_name)
109110
else:
110111
common_ancestor = os.path.commonpath([src_node, dst_node])
112+
common_ancestor = pathlib.Path(common_ancestor).as_posix(
113+
) # in windows, os.path.commonpath will return windows path, we should convert it to posix
111114
src_base_node = src_node
112115
while True:
113116
parent_node = all_ops[src_base_node]['parent_node']

0 commit comments

Comments
 (0)