How to convert a tensorflow hub pretrained model as to be consumable by tensorflow serving

330 views Asked by At

I am trying to use this for my object detection task. The problems I am facing are:

  1. On running the saved_model_cli command, I am getting the following output. There is no signature defined with tag-set "serve" also the method name is empty

enter image description here

  1. The variable folder in the model directory only contains a few bytes of data which means the weights are not actually written to disk.

The model format seems to be HubModule V1 which seems to be the issue, any tips on making the above model servable are highly appreciated.

1

There are 1 answers

0
kempy On

TF2 SavedModels should not have this problem, only Hub.Modules from TF1 since Hub.Modules use the signatures for other purposes. You can take a hub.Module and build a servable SavedModel, but it's quite complex and involves building the signatures yourself.

Instead, I recommend checking out the list of TF2 object detection models on TFHub.dev for a model you can use instead of the model you are using: https://tfhub.dev/s?module-type=image-object-detection&tf-version=tf2

These models should be servable with TF Serving