Skip to content

Commit

Permalink
[Bug] Fix export graph bug in windows (#1244)
Browse files Browse the repository at this point in the history
* fix export graph bug in windows

* fix format
  • Loading branch information
rainyfly authored Apr 4, 2023
1 parent d66066b commit 6ae0838
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions visualdl/component/graph/graph_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# =======================================================================
import collections
import os.path
import pathlib
import re

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

0 comments on commit 6ae0838

Please sign in to comment.