本文取材自imooc课程《Python3+TensorFlow打造人脸识别智能小程序》
Session
图必须在称之为“会话”的上下文中执行
绘画将图的op分发到诸如CPU或GPU之类的设备上执行
- 创建和关闭对话
sess = tf.Session()
sess = tf.InteractiveSession()
sess.close()
with tf.Session() as sess:
...
- 注入机制
sess.run(...)
sess.run(tf.global_variables_initializer())
a = tf.placeholder(dtype=tf.float32)
b = tf.placeholder(dtype=tf.float32)
add