我正在尝试使用tf_serving的docker版本执行此正常的tf_serving命令(该命令正确运行)。我不确定为什么它不起作用。有什么建议吗?我是Docker的新手!
常规tf_serving命令:
tensorflow_model_server \
--model_config_file=/opt/tf_serving/model_config.conf \
--port=6006
这是我的model_config.conf的样子:
model_config_list: {
config: {
name: "model_1",
base_path: "/opt/tf_serving/model_1",
model_platform: "tensorflow",
},
config: {
name: "model_2",
base_path: "/opt/tf_serving/model_2",
model_platform: "tensorflow",
},
}
我正在尝试但无法正常工作的Docker版本的命令:
docker run --runtime=nvidia \
-p 6006:6006 \
--mount type=bind,source=/opt/tf_serving/model_1,target=/models/model_1/ \
--mount type=bind,source=/opt/tf_serving/model_2,target=/models/model_2/ \
--mount type=bind,source=/opt/tf_serving/model_config.conf,target=/config/model_config.conf \
-t tensorflow/serving:latest-gpu --model_config_file=/config/model_config.conf
错误:
2019-04-13 19:41:00.838340:E tensorflow_serving / sources / storage_path / file_system_storage_path_source.cc:369] FileSystemStoragePathSource遇到文件系统访问错误:找不到可服务模型_1的基本路径/ opt / tf_serving / model_1
答案 0 :(得分:0)
发现了问题!您必须按如下所示更改model_config.conf中的模型路径,以上docker命令将起作用并加载两个模型!
model_config_list: {
config: {
name: "model_1",
base_path: "/models/model_1",
model_platform: "tensorflow",
},
config: {
name: "model_2",
base_path: "/models/model_1",
model_platform: "tensorflow",
},
}