查看tensorflow模型所有节点

查看tensorflow模型的所有节点

# tensorflow1
import tensorflow as tf

# 如果tensorflow是2.0以上版本的话,
import tensorflow.compat.v1 as tf

# 要看的tensorflow模型路径,指向tensorflow模型的saved_model文件夹
export_dir = ".//saved_model"

# 把所有节点打印出来
with tf.Session(graph=tf.Graph()) as sess:
    tf.saved_model.loader.load(sess, ['serve'], export_dir)
    print('load model done.')
    input_graph_def = tf.get_default_graph().as_graph_def()
    node_names = [n.name for n  in input_graph_def.node]
    for node in node_names:
        print(node)

部分结果展示

Const
image_tensor
ToFloat
Preprocessor/map/Shape
Preprocessor/map/strided_slice/stack
Preprocessor/map/strided_slice/stack_1
Preprocessor/map/strided_slice/stack_2
Preprocessor/map/strided_slice
Preprocessor/map/TensorArray
Preprocessor/map/TensorArrayUnstack/Shape
Preprocessor/map/TensorArrayUnstack/strided_slice/stack
Preprocessor/map/TensorArrayUnstack/strided_slice/stack_1
Preprocessor/map/TensorArrayUnstack/strided_slice/stack_2
Preprocessor/map/TensorArrayUnstack/strided_slice
Preprocessor/map/TensorArrayUnstack/range/start
Preprocessor/map/TensorArrayUnstack/range/delta
Preprocessor/map/TensorArrayUnstack/range
Preprocessor/map/TensorArrayUnstack/TensorArrayScatter/TensorArrayScatterV3
Preprocessor/map/Const
Preprocessor/map/TensorArray_1
Preprocessor/map/while/Enter
Preprocessor/map/while/Enter_1
Preprocessor/map/while/Merge
Preprocessor/map/while/Merge_1
Preprocessor/map/while/Less/Enter
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/Gather/Switch
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/Gather
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/Rank
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/Shape/Switch
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/Shape
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/strided_slice/stack
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/strided_slice/stack_1
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/strided_slice/stack_2
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/strided_slice
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/sub/x
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/sub
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/ExpandDims/dim
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/ExpandDims
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/Greater/y
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/Greater
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/Switch
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/switch_t
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/switch_f
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/pred_id
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/strided_slice/stack
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/strided_slice/stack_1
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/strided_slice/stack_2
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/strided_slice/Switch
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/strided_slice
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/concat/axis
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/concat/Switch
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/concat
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/sub/x
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/sub/Switch
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/sub
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/ExpandDims/dim
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/ExpandDims
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/cond/Merge
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/zeros/Const
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/zeros
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/concat/axis
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/concat
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/PadOrClipBoxList/cond_3/Merge
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/Shape
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/strided_slice/stack
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/strided_slice/stack_1
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/strided_slice/stack_2
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/strided_slice
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/TensorArrayWrite/TensorArrayWriteV3/Enter
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/TensorArrayWrite/TensorArrayWriteV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/TensorArrayWrite_1/TensorArrayWriteV3/Enter
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/TensorArrayWrite_1/TensorArrayWriteV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/TensorArrayWrite_2/TensorArrayWriteV3/Enter
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/TensorArrayWrite_2/TensorArrayWriteV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/TensorArrayWrite_4/TensorArrayWriteV3/Enter
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/TensorArrayWrite_4/TensorArrayWriteV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/add/y
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/add
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/NextIteration
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/NextIteration_1
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/NextIteration_2
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/NextIteration_3
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/NextIteration_5
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/Exit_1
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/Exit_2
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/Exit_3
Postprocessor/BatchMultiClassNonMaxSuppression/map/while/Exit_5
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack/TensorArraySizeV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack/range/start
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack/range/delta
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack/range
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack/TensorArrayGatherV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_1/TensorArraySizeV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_1/range/start
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_1/range/delta
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_1/range
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_1/TensorArrayGatherV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_2/TensorArraySizeV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_2/range/start
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_2/range/delta
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_2/range
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_2/TensorArrayGatherV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_4/TensorArraySizeV3
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_4/range/start
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_4/range/delta
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_4/range
Postprocessor/BatchMultiClassNonMaxSuppression/map/TensorArrayStack_4/TensorArrayGatherV3
Postprocessor/ToFloat
add_6/y
add_6
detection_boxes
detection_scores
detection_classes
num_detections

你可能感兴趣的:(tensorflow,python,深度学习)