我部署了一个模型,该模型使用 tfhub 模型来使用 docker 进行张量流服务。
这是我的模型中包含的 tfhub 模型:
https://tfhub.dev/google/universal-sentence-encoder-multilingual/1 https://tfhub.dev/google/universal-sentence-encoder-multilingual/1
这是运行docker的命令
docker run -t --rm -p 8501:8501 \
-v "/docker_dir/model_tf_serving:/models/mymodel" \
-e MODEL_NAME=mymodel \
tensorflow/serving &
发生错误:
Not found: Op type not registered 'SentencepieceEncodeSparse' in binary running on c5e507bf091b. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.
那么有没有办法解决这个问题呢?
我不知道你是否仍然遇到这个问题,但这对我有用
- 下载该模块
pip install tensorflow-text
- type
import tensorflow_text
因为 tf-hub 模块依赖于该包。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)