代码只是一份笔记,以免以后忘记了
import tensorflow as tf
from tensorflow.python.framework import graph_util
var1 = tf.Variable(1.0, dtype=tf.float32, name='v1')
var2 = tf.Variable(2.0, dtype=tf.float32, name='v2')
var3 = tf.Variable(2.0, dtype=tf.float32, name='v3')
x = tf.placeholder(dtype=tf.float32, shape=None

本文介绍了使用TensorFlow创建简单模型的过程,包括变量定义、占位符使用、运算操作及模型的保存与重新加载。通过具体代码示例,展示了如何将训练后的模型转化为.pb文件,并在新的会话中读取模型进行预测。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



