tensorflow初探-checkpoint转换成pb

原创
2017/04/13 15:54
阅读数 2.1K
reader = tf.train.NewCheckpointReader(ckpt_file)

with tf.Session() as sess:
    for key in reader.get_variable_to_shape_map():
       tf.Variable(reader.get_tensor(key), name=key)

    #tf.global_variables_initializer()

    with tf.gfile.FastGFile(pb_file, "wb") as f:
        f.write(sess.graph_def.SerializeToString())
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部