Saving a Object Detection API SSD in TF.SavedModel format

Hi All,

The “TF Object Detection API” has this colab:

That shows how to build & train a ssd_resnet50_v1_fpn_640x640_coco17_tpu-8 model using ducky images. The colab runs great, but after training, I wish to know how to save this model in the common TF.SavedModel format (Using the SavedModel format  |  TensorFlow Core).

I have tried using all versions of the ‘exporter_xxx.py’ scripts, and everything gives the same type of errors:
WARNING:absl:Found untraced functions such as
ssd_meta_arch_layer_call_fn,
ssd_meta_arch_layer_call_and_return_conditional_losses,
WeightSharedConvolutionalBoxPredictor_layer_call_fn, WeightSharedConvolutionalBoxPredictor_layer_call_and_return_conditional_losses,
ssd_meta_arch_layer_call_fn while saving (showing 5 of 525). These functions will not be directly callable after loading.

It does produce a saved model, but the model is not usable, giving the error:
“Found zero restored functions for caller function”
When you try to use it.

Does anyone have any code that can be added on to the end of the eager_few_shot_od_training_tf2_colab to save the trained model in the common TF saved model format?

Any help would be appreciated.

Thanks.

Hi @PaulS ,

Given the recent updates in the TensorFlow Model Garden codebase, it’s advisable to test the latest version to check if the mentioned issue has been resolved. If you are still encountering the problem, consider using the most recent codebase.
Thanks