TensorFlow将meta转化为summary,从ckpt查看tensor的name

柔情痞子 提交于 2019-12-28 06:31:33
meta转化为summary用tensorboard查看
import tensorflow as tf
from tensorflow.python.platform import gfile

graph = tf.get_default_graph()
graphdef = graph.as_graph_def()
_ = tf.train.import_meta_graph('meta的路径/xxxx.meta')
summary = tf.summary.FileWriter('summary的路径', graph)
从ckpt查看tensor的name
from tensorflow.python import pywrap_tensorflow
 
checkpoint_path='ckpt的路径/xxxx.ckpt'
reader=pywrap_tensorflow.NewCheckpointReader(checkpoint_path)
var_to_shape_map=reader.get_variable_to_shape_map()
for key in var_to_shape_map:
    print('tensor_name: ', key)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!