loss出错 [predictions must be >= 0] [Condition x >= y did not hold element-wise:]
报错代码:
BaseCollectiveExecutor::StartAbort Invalid argument: assertion failed: [predictions must be >= 0]
[Condition x >= y did not hold element-wise:]
[x (model/conv2d_20/Sigmoid:0) = ] [[[[nan][nan][nan]]]…]
[y (metrics/auc/Cast_1/x:0) = ] [0]
[[{{node metrics/auc/assert_greater_equal/Assert/AssertGuard/else/_1/Assert}}]]
[[metrics/recall/assert_less_equal/Assert/AssertGuard/pivot_f/_69/_121]]
原因:
tf.sqrt()开根号导致在0处不可导NAN
解决:
加个很小的数即可
本文介绍了一种在TensorFlow中遇到的错误,即预测值小于0导致tf.sqrt()出现NAN的问题。该问题源于tf.sqrt()在0处不可导,解决方法是在输入中加入一个非常小的数来避免这种情况。

1911

被折叠的 条评论
为什么被折叠?



