【发布时间】:2018-09-14 11:07:44
【问题描述】:
我正在尝试使用 python 函数“IoU”作为使用 tensorflow.py_func 的 keras 损失函数,如下所示:
def loss_fn(label, pred):
return tensorflow.py_func(IoU, (label, pred), tf.float64)
但不幸的是,我收到以下错误:
TypeError: 'NoneType' object cannot be interpreted as an integer.
我正在使用 Keras 2.2.2 和 tensorflow 1.10.0。
你能帮我解决这个问题吗?
提前致谢。
【问题讨论】:
-
嗨!欢迎来到 StackOverflow!请考虑写一个Minimal, Complete, and Verifiable example (MVCE)。这将大大增加您为您的问题获得正确帮助的几率。
标签: python tensorflow keras loss-function