![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Tensorflow
Mmagic1
自律带来自由!
展开
-
深度学习:Tensorflow模型持久化
Tensorflow训练的模型,常常需要保存下来,便于调用,有两种方式保存:ckpt和pb1、保存为ckpt模型,代码为:import tensorflow as tfv1 = tf.Variable(tf.constant(1.0,shape = [1],name = "v1"))v2 = tf.Variable(tf.constant(2.0,shape = [1],name = "v2"))result = v1 +v2init_op = tf.global_variables原创 2020-05-18 15:53:03 · 284 阅读 · 0 评论 -
深度学习之用TensorBoard查看ckpt和pb图结构
一、查看ckpt图结构1、在ckpt文件所在文件夹中新建check_ckpt.py文件,代码如下import tensorflow as tffrom tensorflow.summary import FileWritersess = tf.Session()tf.train.import_meta_graph("./model.ckpt.meta")FileWriter("__tb", sess.graph)2、运行check_ckpt.py,生成__tb文件夹3、在__tb原创 2020-05-12 11:11:20 · 3365 阅读 · 1 评论