tensorflow - 张量流调试
问题描述
y1 = tf.stack([55, 0, 55])
y2 = tf.stack([11 22 44])
y3 = tf.constant([0., 0., 1.])
x = tf.stack([y1, y2, y3])
x1 = tf.reshape(x, [3, 3])
有没有办法打印或获得上述张量x1
或x
在张量流中。tf.print
和sess.eval(x1)
?_ 它似乎没有打印堆叠的框架。
也试过tfdg
了
sess = tf.Session()
sess = tf_debug.TensorBoardDebugWrapperSession(sess, "Host:7000")
sess.run(x1)
解决方案
做的时候
import tensorflow as tf
import numpy as np
tf.reset_default_graph()
with tf.Session() as sess:
y1 = tf.stack([55, 0, 55])
y2 = tf.stack([11, 22, 44])
y3 = tf.constant([0, 0, 1])
x_tmp = tf.stack([y1, y2, y3])
x1 = tf.reshape(x, [3, 3])
x_res, x1_res = sess.run([x, x1])
print(x_res)
print(x1_res)
好像打印出来了
[[55 0 55]
[11 22 44]
[ 0 0 1]]
[[55 0 55]
[11 22 44]
[ 0 0 1]]
正好?也许我误解了这个问题
推荐阅读
- javascript - 如何使用 props 更改 fetch 语句 React JS 中的 url?
- python - 绘制 RidgeCV 系数作为正则化的函数
- machine-learning - 空间变压器网络中的投资回报率裁剪
- r - 当某些组对于某些模型为空时,使用 purrr 的图按组估计线性回归
- php - 变形字段 id 大小大于 1 的 Laravel 变形表
- php - PHP没有在类中抛出指定的错误消息
- flutter - 动画尺寸增量增加,动画仅在第一次增量时平滑,颤动
- python - 使用 pandas 将值映射到字典
- python - 从 AWS Lambda 函数返回音频文件作为响应
- r - 对多个测试应用校正以获得 p 调整值