Skip to content

Commit 5c7ae2f

Browse files
committed
Modify the log of check_reduntant.
1 parent 8a82a55 commit 5c7ae2f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

graph_net/paddle/check_redundant_incrementally.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,18 @@ def main(args):
5353
if os.path.isfile(graph_hash_path):
5454
graph_hash = open(graph_hash_path).read()
5555
if graph_hash not in graph_hash2graph_net_model_path.keys():
56-
graph_hash2graph_net_model_path[graph_hash] = graph_hash_path
56+
graph_hash2graph_net_model_path[graph_hash] = [graph_hash_path]
5757
else:
5858
find_redundant = True
59-
print(
60-
f"Redundant models detected: {graph_hash2graph_net_model_path[graph_hash]} vs {graph_hash_path}"
61-
)
59+
graph_hash2graph_net_model_path[graph_hash].append(graph_hash_path)
6260
print(
6361
f"Totally {len(graph_hash2graph_net_model_path)} unique samples under {args.graph_net_samples_path}."
6462
)
63+
for graph_hash, graph_paths in graph_hash2graph_net_model_path.items():
64+
if len(graph_paths) > 1:
65+
print(f"Redundant models detected for grap_hash {graph_hash}:")
66+
for model_path in graph_paths:
67+
print(f" {model_path}")
6568
assert (
6669
not find_redundant
6770
), f"Redundant models detected under {args.graph_net_samples_path}."

0 commit comments

Comments
 (0)