tensorflow serving REST API error: could not find base path /models/model for servable model

tensorflow serving REST API error: could not find base path /models/model for servable model

我是 tensorflow serving 和 docker 的新手,我学习了多个教程并想在我重新训练的模型上尝试一下。

当我运行以下代码时出现找不到基本路径的错误,根据我的理解,目标路径不正确并且docker找不到它。如何定义目标路径?非常感谢您的指导!

!docker run -p 8503:8501 \
    --name=ea4 \
    --mount type=bind,source=/home/jupyter/../saved_models/,target=/models/ea4 \
    -e MODEL_NAME=ea4 \
    -t tensorflow/serving

错误:

2020-05-28 01:55:31.719025: I tensorflow_serving/model_servers/server.cc:86] Building single TensorFlow model file config:  model_name: ea4 model_base_path: /models/ea4
2020-05-28 01:55:31.719326: I tensorflow_serving/model_servers/server_core.cc:462] Adding/updating models.
2020-05-28 01:55:31.719363: I tensorflow_serving/model_servers/server_core.cc:573]  (Re-)adding model: ea4
2020-05-28 01:55:31.719784: E tensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:362] FileSystemStoragePathSource encountered a filesystem access error: Could not find base path /models/ea4 for servable ea4
2020-05-28 01:55:32.719680: E tensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:362] FileSystemStoragePathSource encountered a filesystem access error: Could not find base path /models/ea4 for servable ea4

修改如下代码后,端口在docker镜像中正常工作。

!docker run -p 8501:8501 \
    --name=ea \
    -v "/home/../saved_models/:/models/ea/1" \
    -e MODEL_NAME=ea \
    -t tensorflow/serving