美文网首页
Tensorflow查看模型参数

Tensorflow查看模型参数

作者: Fall_Q | 来源:发表于2018-12-18 22:54 被阅读0次

既载入模型结构(Graph),也载入参数值

import tensorflow as tf

# importing graph

saver = tf.train.import_meta_graph("/home/jagger/workspace/tmp/model.ckpt.meta")

with tf.Session() as sess:

# loading variable value to sess

    saver.restore(sess, "/home/jagger/workspace/tmp/model.ckpt")

    result =  tf.get_default_graph().get_tensor_by_name("add:0")   

    print(sess.run(result)) 

相关文章

网友评论

      本文标题:Tensorflow查看模型参数

      本文链接:https://www.haomeiwen.com/subject/cfwrkqtx.html