Browse Source

!482 告警清除

Merge pull request !482 from 赵鲁鹏/com
pull/484/head
i-robot Gitee 3 years ago
parent
commit
d1a40e672e
No known key found for this signature in database GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 13 additions and 13 deletions
  1. +13
    -13
      parser/func_to_graph/func2graph.py

+ 13
- 13
parser/func_to_graph/func2graph.py View File

@@ -227,9 +227,9 @@ def convert_subgraphs(graph_def, filename):
print(graph_def_library.graph_def[i]) print(graph_def_library.graph_def[i])


# Write to prototxt # Write to prototxt
graph_def_file = '{}/graph_def_library.pbtxt'.format(os.path.dirname(os.path.abspath(filename)))
print("graph_def_file: ", graph_def_file)
try: try:
graph_def_file = '{}/graph_def_library.pbtxt'.format(os.path.dirname(os.path.abspath(filename)))
print("graph_def_file: ", graph_def_file)
with open(graph_def_file, "w") as f: with open(graph_def_file, "w") as f:
print(graph_def_library, file=f) print(graph_def_library, file=f)
except IOError: except IOError:
@@ -261,18 +261,18 @@ if __name__ == '__main__':
model = '' model = ''
try: try:
opts, args = getopt.getopt(sys.argv[1:], '-v-h-m:', ['version', 'help', 'model=']) opts, args = getopt.getopt(sys.argv[1:], '-v-h-m:', ['version', 'help', 'model='])
for opt_name, opt_value in opts:
if opt_name in ('-m', '--model'):
model = opt_value
print("INFO: Input model file is", model)
convert_graphs(model)
elif opt_name in ('-h', '--help'):
usage()
break
elif opt_name in ('-v', '--version'):
print("version 1.0.0")
break
except getopt.GetoptError: except getopt.GetoptError:
print("ERROR: Input parameters is invalid, use '--help' to view the help.") print("ERROR: Input parameters is invalid, use '--help' to view the help.")
for opt_name, opt_value in opts:
if opt_name in ('-m', '--model'):
model = opt_value
print("INFO: Input model file is", model)
convert_graphs(model)
elif opt_name in ('-h', '--help'):
usage()
break
elif opt_name in ('-v', '--version'):
print("version 1.0.0")
break
if len(sys.argv) == 1: if len(sys.argv) == 1:
print("INFO: Please specify the input parameters, and use '--help' to view the help.") print("INFO: Please specify the input parameters, and use '--help' to view the help.")

Loading…
Cancel
Save