我正在尝试使用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遇到文件系统访问错误:找不到基本路径/ opt / tf_serving / model_1 for servable model_1
发现了这个问题!您必须按照以下方式更改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",
},
}