Run docker container Error: Could not find base path /models/model for servable model

Viewed 4740

Im have problem when I've trying to run a docker container using docker image: tensorflow/serving.

  1. I run the cmd:

docker run --name=tf_serving -it tensorflow/serving

  1. The result is:
2019-10-28 04:23:56.858540: I tensorflow_serving/model_servers/server_core.cc:462] Adding/updating models.
2019-10-28 04:23:56.858571: I tensorflow_serving/model_servers/server_core.cc:573]  (Re-)adding model: model
2019-10-28 04:23:56.858852: 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/model for servable model

I've digging to resolve it but still there. Could anyone please have any idea for this, thanks so much!

3 Answers

I found the solution, for someone who has the same problems, we need to provide the model path in the local computer and in docker:

docker run --name=the_name -p 9000:9000 -it -v "/path_to_the_model_in_computer:/path_to_model_in_docker" tensorflow/serving:1.15.0 --model_name=MODEL_NAME --port=9000

I encountered the same problem

docker run -p 8501:8501 --name tensorflowserving \
--mount type=bind,source=absolute path to model/resnet,target=/models/resnet \
-e MODEL_NAME=resnet -t tensorflow/serving

The models was the course of this error in my case.

explaination of arguements which i found very helpful

  • -p 8501:8501: This is the REST Endpoint port. Every prediction request will be made to this port. For instance, you can make a prediction request to http://localhost:8501.

    — name tensorflowserving: This is a name given to the Docker container running TF Serving. It can be used to start and stop the container instance later.

    — mount type=bind,source=/Users/tf-server/img_classifier/,

    target=/models/img_classifier: The mount command simply copies the model from the specified path (/Users/tf-server/img_classifier/) into the Docker container (/models/img_classifier), so that TF Serving has access to it

You should provide the saved model path. Serving container will find all the models in its /models dir. You can use -v for docker run command. Doing like this:

docker run --name=tf_serving -it -v /path/to/saved_model:/models/saved_model tensorflow/serving
Related