![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
「已注销」
这个作者很懒,什么都没留下…
展开
-
转载:直接保存为pb模型
第一种保存pb方法 写入序列化的 PB 文件: with tf.gfile.FastGFile(pb_file_path+'model.pb', mode='wb') as f: f.write(constant_graph.SerializeToString()) 第二种保存pb方法: ...转载 2019-11-20 09:57:15 · 728 阅读 · 0 评论 -
tensorflow: 调用训练好的pb模型实例
(1)将保存的模型文件解析为GraphDef :graph_def.ParseFromString(gfile.FastGFile(“model.pb”,‘rb’).read()),这里分为两步,一:通过gfile.FastGFile(“model.pb”,‘rb’).read()获取保存的pb模型对象并读取文件,二: graph_def = tf.GraphDef()创建graph_def对...原创 2019-11-19 17:03:38 · 3851 阅读 · 2 评论 -
tensorflow: ckpt模型转成pb模型
title: ckpt模型转pb模型手册 tags: tensorflow,ckpt,pb 为什么要把ckpt格式转为pb格式? ckpt格式的模型图结构和权重参数模型是分开保存在不同的文件里,而pb模型的图结构和权重参数的模型是保存在同一个文件中的,很多时候我们需要一个既包含图又包含变量的模型文件 ckpt格式模型包含的文件如下: 我们在checkpoint_dir目录下保存的文件结构如下: ...原创 2019-11-15 17:04:58 · 1491 阅读 · 0 评论