tensorflow fetch 取回某个值
Tensorflow 某个 fetch
2023-09-14 09:15:50 时间
为了取回操作的输出内容, 可以在使用 Session 对象的 run() 调用 执行图时,
传入一些 tensor, 这些 tensor 会帮助你取回结果. 在之前的例子里,
我们只取回了单个节点 state, 但是你也可以取回多个 tensor:
import tensorflow as tf
input1 = tf.constant(3.0)
input2 = tf.constant(2.0)
input3 = tf.constant(5.0)
intermed = tf.add(input2, input3)
mul = tf.multiply(input1, intermed)
with tf.Session() as sess:
result = sess.run([mul, intermed])
print (result)
相关文章
- DL之IDE:深度学习环境安装之Tensorflow/tensorflow_gpu+Cuda+Cudnn(最清楚/最快捷)之详细攻略(图文教程)
- Tensorflow Serving Docker compose 部署服务细节(Ubuntu)
- 使用TensorFlow构建面部口罩识别系统【本文源码开箱即用】
- TensorRT加速 ——NVIDIA终端AI芯片加速用,可以直接利用caffe或TensorFlow生成的模型来predict(inference)
- 【Tensorflow 2】解决tensorflow.python.framework.errors_impl.UnknownError: [_Derived_] Fail to find the
- 【Deepin 20系统】Linux系统安装Anaconda和Tensorflow-gpu2.3
- 【TensorFlow 入门】7、定义图变量的方法
- TensorFlow实战调试中所遇问题及解决方法2
- tensorflow 进阶(二),BP神经网络