【发布时间】:2018-09-10 14:10:06
【问题描述】:
我正在尝试创建自己的损失函数:
def custom_mse(y_true, y_pred):
tmp = 10000000000
a = list(itertools.permutations(y_pred))
for i in range(0, len(a)):
t = K.mean(K.square(a[i] - y_true), axis=-1)
if t < tmp :
tmp = t
return tmp
它应该创建预测向量的排列,并返回最小的损失。
"Tensor objects are not iterable when eager execution is not "
TypeError: Tensor objects are not iterable when eager execution is not enabled. To iterate over this tensor use tf.map_fn.
错误。我找不到此错误的任何来源。为什么会这样?
【问题讨论】:
标签: python neural-network keras artificial-intelligence conv-neural-network