如何通过标准tensorflow服务docker镜像来服务模型的多个版本? [英] How to serve multiple versions of model via standard tensorflow serving docker image?

查看:127
本文介绍了如何通过标准tensorflow服务docker镜像来服务模型的多个版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Tensorflow服务的新手,

I'm new to Tensorflow serving,

我刚刚尝试使用本教程并成功。

I just tried Tensorflow serving via docker with this tutorial and succeeded.

但是,当我尝试使用多个版本时,它仅提供最新版本

However, when I tried it with multiple versions, it serves only the latest version.

有可能这样做吗?还是我需要尝试一些不同的东西?

Is it possible to do that? Or do I need to try something different?

推荐答案

我找到了一种方法,可以通过构建自己的使用-model_config_file 选项代替-model_name -model_base_path

I found a way to achieve this by building my own docker image which uses --model_config_file option instead of --model_name and --model_base_path.

所以我正在使用以下命令运行tensorflow服务。

So I'm running tensorflow serving with below command.

docker运行-p 8501:8501 -v {local_path_of_models.conf}:/ models -t {docker_iamge_name}

当然,我写了'models 。

Of course, I wrote 'models.conf' for multiple models also.

编辑:

下面是什么我是从原始docker文件中修改的。

Below is what I modified from original docker file.

原始版本:

tensorflow_model_server --port = 8500 --rest_api_port = 8501 \
--model_name = $ {MODEL_NAME} --model_base_path = $ {MODEL_BASE_PATH} / $ {MODEL_NAME} \

修改版本:

tensorflow_model_server --port = 8500 --rest_api_port = 8501 \
--model_ config_file = $ {MODEL_BASE_PATH} /models.conf \

这篇关于如何通过标准tensorflow服务docker镜像来服务模型的多个版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆