tensorflow怎么查看.ckpt内保存的权重名和权重值

import os
from tensorflow.python import pywrap_tensorflow

checkpoint_path = os.path.join("C://Users//gmt//Desktop//rdb//", ".\\model.ckpt")
# 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))

 

 

你可能感兴趣的:(tensorflow)