作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
实际上,我在 TensorFlow 1.13.0 中已经发现了这个问题。 (tensorflow1.12.0 运行良好)。
我的代码被列为一个简单的例子:
def Lambda layer(temp):
print(temp)
return temp
print(temp)
可以输出如下的详细数据
[<tf.Tensor: id=250, shape=(1024, 2, 32), dtype=complex64, numpy=
array([[[ 7.68014073e-01+0.95353246j, 7.01403618e-01+0.64385843j,
8.30483198e-01+1.0340731j , ..., -8.88018191e-01+0.4751519j ,
-1.20197642e+00+0.6313924j , -1.03787208e+00+0.22964947j],
[-7.94382274e-01+0.56390345j, -4.73938555e-01+0.55901265j,
-8.73749971e-01+0.67095983j, ..., -5.81580341e-01-0.91620034j,
-7.04443693e-01-1.2709806j , -3.23135853e-01-1.0887597j ]],
Tensor("lambda_1/truediv:0", shape=(None, 1), dtype=float32)
最佳答案
您会看到该输出,因为 Keras 模型正在转换为其图形表示,因此 print
打印 tf.Tensor
图描述。
查看tf.Tensor
的内容使用 Tensorflow 2.0 时,您应该使用 tf.print
而不是 print
因为前者被转换为其图形表示,而后者则不会。
关于tensorflow - 如何在 TensorFlow 2.0 中调试 Keras?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55682941/
我是一名优秀的程序员,十分优秀!