TensorFlow通过docker服务多个模型 [英] TensorFlow Serving multiple models via docker

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

问题描述

我无法通过TensorFlow在Windows 10计算机上通过docker服务运行2个或更多模型。



我已经制作了一个模型。配置文件

  model_config_list:{

配置:{
名称: ukpred2,
base_path: / models / my_models / ukpred2,
model_platform: tensorflow
},
config:{
名称: model3,
base_path: / models / my_models / ukpred3,
model_platform: tensorflow
}
}

docker run -p 8501:8501-装载类型=绑定,来源= C:\用户\th3182\文档\临时模型\目标= / models / my_models-装载类型=绑定,来源= C:\ \用户\3182\文档\temp\models.config,target = / models / models.config -t tensorflow / serving --model_config_file = / models / models.config

C:\Users\th3182\Documents\temp\models 有2个文件夹 ukpred2 ukpred3 是这些文件夹中从t导出的文件夹他训练了模型,即 1536668276 ,其中包含资产文件夹和变量文件夹和 saved_model.ph 文件。



我得到的错误是

  2018-09-13 15:24:50.567686:I tensorflow_serving / model_servers / main.cc:157]构建单个TensorFlow模型文件配置:model_name:model model_base_path: / models / model 
2018-09-13 15:24:50.568209:我tensorflow_serving / model_servers / server_core.cc:462]添加/更新模型。
2018-09-13 15:24:50.568242:我tensorflow_serving / model_servers / server_core.cc:517​​](重新)添加模型:模型
2018-09-13 15:24:50.568640:E tensorflow_serving / sources / storage_path / file_system_storage_path_source.cc:369] FileSystemStoragePathSource遇到文件系统访问错误:找不到可服务模型


我似乎无法使它与上面的更改一起使用。但是我已经使用以下命令设法将单个模型服务器化

  docker run -p 8501:8501 --mount type = bind ,source = C:\Usersth3182\Documents\projects\Better_Buyer2\model2\export\exporter,target = / models / model2 -e MODEL_NAME = model2 -t tensorflow / serving 


解决方案

您必须等待下一个版本(1.11.0)为此工作。在此期间,您可以使用图像tensorflow / serving:night或tensorflow / serving:1.11.0-rc0


I am unable to run 2 or more models via TensorFlow Serving via docker on a Windows 10 machine.

I have made a models.config file

model_config_list: {

config: {
    name: "ukpred2",
    base_path: "/models/my_models/ukpred2",
    model_platform: "tensorflow"
    },
config: {
    name: "model3",
    base_path: "/models/my_models/ukpred3",
    model_platform: "tensorflow"
    }
}

docker run -p 8501:8501 --mount type=bind,source=C:\Users\th3182\Documents\temp\models\,target=/models/my_models --mount type=bind,source=C:\Users\th3182\Documents\temp\models.config,target=/models/models.config -t tensorflow/serving --model_config_file=/models/models.config

In C:\Users\th3182\Documents\temp\models are 2 folders ukpred2 and ukpred3 in these folders are the exported folders from the trained models ie 1536668276 which contains an assets folder a variables folder and a saved_model.ph file.

The error I get is

2018-09-13 15:24:50.567686: I tensorflow_serving/model_servers/main.cc:157] Building single TensorFlow model file config:  model_name: model model_base_path: /models/model
2018-09-13 15:24:50.568209: I tensorflow_serving/model_servers/server_core.cc:462] Adding/updating models.
2018-09-13 15:24:50.568242: I tensorflow_serving/model_servers/server_core.cc:517]  (Re-)adding model: model
2018-09-13 15:24:50.568640: E tensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:369] FileSystemStoragePathSource encountered a file-system access error: Could not find base path /models/model for servable model

I can't seem to get this to work with the alterations on the above. But I have managed to server a single model with the following command

docker run -p 8501:8501 --mount type=bind,source=C:\Users\th3182\Documents\projects\Better_Buyer2\model2\export\exporter,target=/models/model2 -e MODEL_NAME=model2 -t tensorflow/serving

解决方案

You'll have to wait for the next release (1.11.0) for this to work. In the interim, you can use the image tensorflow/serving:nightly or tensorflow/serving:1.11.0-rc0

这篇关于TensorFlow通过docker服务多个模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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