首页 > 其他 > 详细

查看chekpoit文件

时间:2018-08-25 20:56:31      阅读:209      评论:0      收藏:0      [点我收藏+]

使用tf.train.Saver()保存到checkpoint文件,我们可以用tensorflow查看。

# import the inspect_checkpoint library
from tensorflow.python.tools import inspect_checkpoint as chkp

# print all tensors in checkpoint file
chkp.print_tensors_in_checkpoint_file("/tmp/model.ckpt", tensor_name=‘‘, all_tensors=True)

# tensor_name:  v1
# [ 1.  1.  1.]
# tensor_name:  v2
# [-1. -1. -1. -1. -1.]

# print only tensor v1 in checkpoint file
chkp.print_tensors_in_checkpoint_file("/tmp/model.ckpt", tensor_name=v1, all_tensors=False)

# tensor_name:  v1
# [ 1.  1.  1.]

# print only tensor v2 in checkpoint file
chkp.print_tensors_in_checkpoint_file("/tmp/model.ckpt", tensor_name=v2, all_tensors=False)

# tensor_name:  v2
# [-1. -1. -1. -1. -1.]

 

查看chekpoit文件

原文:https://www.cnblogs.com/superxuezhazha/p/9535279.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!