tf.py_func采坑记

脑子是个好东西,真的希望我也有一个!!!

tf.py_func时

tf.py_func(
    func,
    inp,
    Tout,
    stateful=True,
    name=None
)

要千万注意Tout: A list or tuple of tensorflow data types or a single tensorflow data type if there is only one, indicating what func returns.这个参数。一定一定要和func返回的类型对上,必要时,可以用x.dtype先看下是什么类型。

因为如果这里的类型对不上,代码既不会报错,也不会返回值。有一种代码跑到这里,凭空消失的感觉。。。。。

发布了45 篇原创文章 · 获赞 1 · 访问量 8570

猜你喜欢

转载自blog.csdn.net/qq_32110859/article/details/101286739