0

I trained an image classifying model using GCP AutoML Vision and I would like to deploy it in my own web app using Docker. Following the tutorial from GCP, I exported my Vision autoML model to a saved_model.pb and managed to copy it to my local drive.

sudo docker run --rm --name ${CONTAINER_NAME} -p ${PORT}:8501 -v ${YOUR_MODEL_PATH}:/tmp/mounted_model/0001 -t ${CPU_DOCKER_GCR_PATH}

When I tried to run the docker image, there's an error. Error message below:

2020-03-18 06:52:52.851811: I tensorflow_serving/model_servers/server_core.cc:462] Adding/updating models.
2020-03-18 06:52:52.851825: I tensorflow_serving/model_servers/server_core.cc:559]  (Re-)adding model: default
2020-03-18 06:52:52.859873: I tensorflow_serving/core/basic_manager.cc:739] Successfully reserved resources to load servable {name: default version: 1}
2020-03-18 06:52:52.859923: I tensorflow_serving/core/loader_harness.cc:66] Approving load for servable version {name: default version: 1}
2020-03-18 06:52:52.859938: I tensorflow_serving/core/loader_harness.cc:74] Loading servable version {name: default version: 1}
2020-03-18 06:52:52.860387: I external/org_tensorflow/tensorflow/contrib/session_bundle/bundle_shim.cc:363] Attempting to load native SavedModelBundle in bundle-shim from: /tmp/mounted_model/0001
2020-03-18 06:52:52.860426: I external/org_tensorflow/tensorflow/cc/saved_model/reader.cc:31] Reading SavedModel from: /tmp/mounted_model/0001
2020-03-18 06:52:52.861256: I external/org_tensorflow/tensorflow/cc/saved_model/reader.cc:54] Reading meta graph with tags { serve }
2020-03-18 06:52:52.861345: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:310] SavedModel load for tags { serve }; Status: fail. Took 916 microseconds.
2020-03-18 06:52:52.861357: E tensorflow_serving/util/retrier.cc:37] Loading servable: {name: default version: 1} failed: Not found: Could not find meta graph def matching supplied tags: { serve }. To inspect available tag-sets in the SavedModel, please use the SavedModel CLI: `saved_model_cli`

I did some researches online, it seems the problem lies on the exporting part of the model, which GCP does not offer any options when I'm exporting the model. I could really use the help, thanks guys.

L.N.
  • 1

1 Answers1

0

Seems that the model doesn't have a graph corresponding to the serving tag.

I found a similar issue reported in the Tensorflow github page. To inspect the available tag-sets in a saved model you can use the SavedModel CLI, you can use the saved_model_cli to inspect the tags:

$ saved_model_cli show --dir ./modelDir

I found how add the serving tag to the model from Tensorflow Hub and it seems that using Transfer Learning could help you to export or save the model with the serving tag.

Enrique Zetina
  • 825
  • 5
  • 16