关闭tensorflow自动签名

关闭tensorflow自动签名,tensorflow,graph,eager-execution,Tensorflow,Graph,Eager Execution,我使用的是tf.data.Dataset.map(process\u fn)指令, 映射函数是由纯张量流图函数组成的,但似乎Autograph正在尝试对它们进行变换。我怎样才能预防它 我怎样才能强制tensorflow使用我的代码(定义图形)的图片呢 def process_fn(item): assert 'image' in item # this should be executed right not every time graph is executed im

我使用的是
tf.data.Dataset.map(process\u fn)
指令, 映射函数是由纯张量流图函数组成的,但似乎Autograph正在尝试对它们进行变换。我怎样才能预防它

我怎样才能强制tensorflow使用我的代码(定义图形)的图片呢

def process_fn(item):
    assert 'image' in item
    # this should be executed right not every time graph is executed
    image = tf.image.convert_image_dtype(item.pop('image'), tf.float32)
    image = tf.multiply(tf.subtract(image, 0.5), 2)
    return image
出于某种原因,tensorflow希望转换此函数,并报告一条警告:这是不可能的,它将按原样使用。 问题是,为什么一开始就有人试图使用亲笔签名

W0119 14:55:15.113813 140297917577024 ag_logging.py:146] Entity 
<function geospatial_input.<locals>.process_fn at 0x7f991b5fe280> could 
not be transformed and will be executed as-is. Please report this to 
the AutoGraph team. When filing the bug, set the verbosity to 10 (on 
Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output.
W0119 14:55:15.113813 140297917577024 ag_logging.py:146]实体
能够
不会被转换,将按原样执行。请将此报告给
签名队。归档错误时,将详细度设置为10(打开
Linux,`export AUTOGRAPH\u VERBOSITY=10`)并附加完整的输出。
对于v2.2(返回到v1.15),您可以使用:


有类似的问题,但不知道如何实现上述答案。你能提供详细信息吗?我把代码放在哪里?
@tf.autograph.experimental.do_not_convert
def process_fn(item):
    ...