【发布时间】:2019-09-05 01:36:47
【问题描述】:
实际上,我在 TensorFlow 1.13.0 中已经发现了问题。 (tensorflow1.12.0 效果很好)。
我的代码作为一个简单的例子列出:
def Lambda layer(temp):
print(temp)
return temp
在我的 Keras 模型中用作 lambda 层。
在tensorflow1.12.0中,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 ]],
这是因为我使用 1024 作为 batch_size。但是当我更新到 tensorflow1.13.0 或 TensorFlow 2.0 时,同样的代码输出
Tensor("lambda_1/truediv:0", shape=(None, 1), dtype=float32)
这很糟糕,因为我不知道确切的错误。 那么,您知道如何解决它吗?
【问题讨论】:
标签: tensorflow keras tensorflow2.0 eager-execution