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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Geoffrey_MT/article/details/82690340
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))

猜你喜欢

转载自blog.csdn.net/Geoffrey_MT/article/details/82690340
今日推荐