如何在tensorflow服务中使用其他tokenlizer(NLTK,Jiebe等)

时间:2019-06-24 08:00:55

标签: tensorflow tensorflow-estimator serving

最近,我一直在使用estimator训练和部署张量流模型,但是当我使用tensorflow sevision部署模型(模型是使用estimator serving_fn包括tf.py_func导出)时,出现错误(请参见下文)。

我在Github上发现了一个问题,即该服务不支持tf.py_func

有人可以帮忙吗?

我想使用其他tokenlizer(NLTK,Jieba)实现令牌功能。

错误:

Invalid argument: No OpKernel was registered to support Op 'PyFunc' used by {{node map/while/PyFunc}}with these attrs: [Tout=[DT_STRING], token="pyfunc_4", _output_shapes=[<unknown>], Tin=[DT_STRING]]
Registered devices: [CPU]
Registered kernels:
  <no registered kernels>

1 个答案:

答案 0 :(得分:1)

您是否尝试过使用tensorflow本机标记器,例如参见https://www.tensorflow.org/beta/tutorials/tensorflow_text/intro#tokenization