Loading models from google cloud storage
Is there a recommended way to load models from google cloud storage instead of a local directory? I can think of a few solutions:
- Create gcloud_storage_path_source.h parallel to file_system_storage_path_source.h by overriding source.h.
- Run a rsync daemon in the serving VM to sync models locally with gcloud storage, and then serve those models
Are there other recommended techniques out there for doing this?
Thanks!
I believe there is already support for that. Did you try loading a model with a "gs://..." path?
e.g. tensorflow_model_server --port=8080 --model_base_path=gs://...
Yes, I did.
I tried:
bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server --port=9000 --model_name=mnist --model_base_path=gs://team-models/mnist_models/
I got the following error:
2017-10-18 18:19:07.214881: E tensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:370] FileSystemStoragePathSource encountered a file-system access error: Could not find base path gs://team-models/mnist_models/ for servable mnist
Just to confirm, "team-models" is your bucket name and you have read access? What's the output of
gsutil ls gs://team-models/mnist_models?
You were right it does work. I was giving it a wrong folder name. Thanks very much!
Can you link to the doc where this is explained?
Does this still work?
Can I do something like below?
docker run -p 8500:8500 --mount type=bind,source=gs://<bucket-name>/Model,target=/models/Model -e MODEL_NAME=Model -t tensorflow/serving &
You can use GCS directly in base_path like this:
tensorflow_model_server --port=8080 --model_base_path=gs://bucket_name/folder_models/
If you have your models in gs://bucket_name/serving_model, you can serve the latest model like this:
docker run -p 8501:8501 -e MODEL_BASE_PATH=gs://bucket_name -e MODEL_NAME=serving_model -t tensorflow/serving