Browse Source

fix duplicate name for node and parameter

tags/v1.2.0-rc1
jiangshuqiang 4 years ago
parent
commit
072c743f2b
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      mindinsight/datavisual/data_transform/graph/msgraph.py

+ 7
- 2
mindinsight/datavisual/data_transform/graph/msgraph.py View File

@@ -1,4 +1,4 @@
# Copyright 2020 Huawei Technologies Co., Ltd
# Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -59,7 +59,12 @@ class MSGraph(Graph):
logger.warning("Finding a node with an empty name will not save it.")
continue

if not node_proto.full_name or any(
if node_proto.op_type == "Load":
# The Load operator needs to be renamed as it has the same name with parameter
node_name = Node.create_node_name(scope=node_proto.scope,
base_name=f'{node_proto.op_type}-op{node_proto.name}')
node_proto.full_name = node_name
elif not node_proto.full_name or any(
node_proto.full_name.lower().endswith(f'[:{plugin.value.lower()}]') for plugin in PluginNameEnum):
node_name = Node.create_node_name(scope=node_proto.scope,
base_name=f'{node_proto.op_type}{node_proto.name}')


Loading…
Cancel
Save