Can't convert openimages_v4/ssd/mobilenet_v2
Hi @chauxb Thanks for reporting this issue.

Can you please mention the steps you have followed for using the hub model and tflite conversion.

I have tried converting the https://tfhub.dev/google/openimages_v4/ssd/mobilenet_v2/1 model and was able to successfully convert into tflite model.

Please find the gist [here](https://colab.research.google.com/gist/pjpratik/9a5b7af9d09b2d6e988c333df8b02d47/59965.ipynb) and let us know if it helps.

Thanks. Hello @pjpratik 

First thank you for your answer and the help you gave me.
Your gist indeed works very well and I was able to convert the model. I think what I was not doing is using the tensorflow hub  with the kera layers and using the flag as you did.
Here is the exact code I used :

```
import tensorflow as tf

# Convert the model
converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir) # path to the SavedModel directory
tflite_model = converter.convert()

# Save the model.
with open('model.tflite', 'wb') as f:
  f.write(tflite_model)
```

Edit : it seems tensorflow lite metadata needs metadata to work in the app : is it not provided by pretrained models ?

```
java.lang.AssertionError: Error occurred when initializing ObjectDetector: Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to preprocess input images.
``` Hi @chauxb 

The pre trained lite models in TF hub provide metadata. However, you can add metadata given a tflite model using [TFLIte meta data writer API](https://www.tensorflow.org/lite/models/convert/metadata_writer_tutorial).

Please find the overview of adding metada [here](https://www.tensorflow.org/lite/models/convert/metadata) along with examples.

Please feel free to close the issue if it is resolved.

Thanks. This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59965">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59965">No</a>

### 1. System information

- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Arch Linux 
- TensorFlow installation (pip package or built from source): pip package
- TensorFlow library (version, if pip package or github SHA, if built from source): 2.11.0

### 2. Code

Provide code to help us reproduce your issues using one of the following options:

#### Option B: Paste your code here or provide a link to a custom end-to-end colab

I follow the code to convert a saved model to tflite from tensorflow website here : https://www.tensorflow.org/lite/models/convert/convert_models#convert_a_savedmodel_recommended_

The model I want to convert is this one : 
https://tfhub.dev/google/openimages_v4/ssd/mobilenet_v2/1

I would like to use it in the android example of tensorflow lite: 

https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/android

```
(You can paste links or attach files by dragging & dropping them below)
- Include code to invoke the TFLite Converter Python API and the errors.
- Provide links to your TensorFlow model and (optionally) TensorFlow Lite Model.
```

### 3. Failure after conversion
If the conversion is successful, but the generated model is wrong, then state what is wrong:

- Model produces wrong results and/or has lesser accuracy.
- Model produces correct results, but it is slower than expected.

The conversion is unsuccessful.

### 4. (optional) RNN conversion support
If converting TF RNN to TFLite fused RNN ops, please prefix [RNN] in the title.

### 5. (optional) Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

```

2023-03-12 19:16:36.621905: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-03-12 19:16:36.719912: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2023-03-12 19:16:36.719933: I tensorflow/compiler/xla/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2023-03-12 19:16:37.381249: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory
2023-03-12 19:16:37.381323: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory
2023-03-12 19:16:37.381337: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
Traceback (most recent call last):
File "/home/chauxb/Downloads/tensorflow/convert.py", line 4, in <module>
    converter = tf.lite.TFLiteConverter.from_saved_model("/home/chauxb/Downloads/tensorflow/openimages/") # path to the SavedModel directory
  File "/home/chauxb/.local/lib/python3.10/site-packages/tensorflow/lite/python/lite.py", line 1792, in from_saved_model
    saved_model = _load(saved_model_dir, tags)
  File "/home/chauxb/.local/lib/python3.10/site-packages/tensorflow/python/saved_model/load.py", line 828, in load
    result = load_partial(export_dir, None, tags, options)["root"]
  File "/home/chauxb/.local/lib/python3.10/site-packages/tensorflow/python/saved_model/load.py", line 977, in load_partial
    root = load_v1_in_v2.load(export_dir, tags)
  File "/home/chauxb/.local/lib/python3.10/site-packages/tensorflow/python/saved_model/load_v1_in_v2.py", line 284, in load
    result = loader.load(tags=tags)
  File "/home/chauxb/.local/lib/python3.10/site-packages/tensorflow/python/saved_model/load_v1_in_v2.py", line 209, in load
    meta_graph_def = self.get_meta_graph_def_from_tags(tags)
  File "/home/chauxb/.local/lib/python3.10/site-packages/tensorflow/python/saved_model/load_v1_in_v2.py", line 88, in get_meta_graph_def_from_tags
    return super(_EagerSavedModelLoader, self).get_meta_graph_def_from_tags(
  File "/home/chauxb/.local/lib/python3.10/site-packages/tensorflow/python/saved_model/loader_impl.py", line 391, in get_meta_graph_def_from_tags
    raise RuntimeError(
RuntimeError: MetaGraphDef associated with tags {'serve'} could not be found in SavedModel, with available tags '[set()]'. To inspect available tag-sets in the SavedModel, please use the SavedModel CLI: `saved_model_cli`.

```

Am I missing something in my conversion?
I am new to this so maybe I am doing something wrong (first time doing a model conversion)?

Thank you for your help in advance 