查看tensorflow的ckpt文件节点信息

import os
from tensorflow.python import pywrap_tensorflow
 
checkpoint_path = os.path.join(path)
# Read data from checkpoint file
reader = pywrap_tensorflow.NewCheckpointReader(checkpoint_path)
var_to_shape_map = reader.get_variable_to_shape_map()
# Print tensor name and values
for key in var_to_shape_map:
    print("tensor_name: ", key)
    print(reader.get_tensor(key))

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