Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def describe_graph(graph_def, show_nodes=False):
- print('Input Feature Nodes: {}'.format(
- [node.name for node in graph_def.node if node.op=='Placeholder']))
- print('')
- print('Unused Nodes: {}'.format(
- [node.name for node in graph_def.node if 'unused' in node.name]))
- print('')
- print('Output Nodes: {}'.format(
- [node.name for node in graph_def.node if 'predictions' in node.name]))
- print('')
- print('Quantization Nodes: {}'.format(
- [node.name for node in graph_def.node if 'quant' in node.name]))
- print('')
- print('Constant Count: {}'.format(
- len([node for node in graph_def.node if node.op=='Const'])))
- print('')
- print('Variable Count: {}'.format(
- len([node for node in graph_def.node if 'Variable' in node.op])))
- print('')
- print('Identity Count: {}'.format(
- len([node for node in graph_def.node if node.op=='Identity'])))
- print('', 'Total nodes: {}'.format(len(graph_def.node)), '')
- if show_nodes==True:
- for node in graph_def.node:
- print('Op:{} - Name: {}'.format(node.op, node.name))
Add Comment
Please, Sign In to add comment