ValueError: Checkpoint was expecting to be a trackable object (an object derived from `Trackable`)
Hello, @Mr-Joe-Cool ! I replicated the issue reported [here](https://colab.research.google.com/gist/sushreebarsa/b1e5d330b466d23ea4debdc289ff8e82/61179.ipynb) and seems like you're using some deprecated apis which are not compatible with the latest version for few packages. Looks like some version incompatibility as well. Please have a look at the gist and confirm the same. 
Thank you! Thanks @sushreebarsa ! I currently don't have access to my computer to check the api versions I'm running. I will get back to you on this issue on Wednesday :)  @sushreebarsa It seems like your replication is giving out a different error than mine. I replaced that deprecated code (tf.contrib) already so I don't get that error anymore. @Mr-Joe-Cool Thank you for the response!
Could you please let me know if the issue is resolved and it's good to close ?
Thank you! @sushreebarsa The original issue has still not been resolved. I was referring to the error you were getting in your replicated code. I had fixed that error already before posting this issue.  @sushreebarsa I am using the Tensorflow object detection API and it's the same version as the gist. Should I be using a different version? @Mr-Joe-Cool Could you try with TF v2.13, if that helps?
Thank you!  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/61179">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/61179">No</a>

### Issue type

Bug

### Source

binary

### TensorFlow version

tf 2.10.0

### Custom code

Yes

### OS platform and distribution

Windows 10 Enterprise

### Python version

3.9.16

### Current behavior?

I'm receiving an error when I try to restore the model checkpoint. I've seen a posting on here that's similar, but I think my case is different. Help is very much appreciated!

I'm using a pre-trained object detection model called SSD MobileNet V2 FPNLite 320x320 


### Standalone code to reproduce the issue

```python
import os
import tensorflow as tf
import pandas as pd
import openpyxl
import cv2 
import numpy as np

from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as viz_utils
from object_detection.builders import model_builder
from object_detection.utils import config_util
from matplotlib import pyplot as plt
from pathlib import Path


os.chdir(r"C:\Users\mill286")

CUSTOM_MODEL_NAME = 'my_ssd_resnet50_v1_fpn' # *** Enter here the name of the model you trained. ***
files = {
    'PIPELINE_CONFIG':os.path.join('tensorflow', 'workspace','models', CUSTOM_MODEL_NAME, 'pipeline.config')
}
# Load pipeline config and build a detection model
configs = config_util.get_configs_from_pipeline_file(files['PIPELINE_CONFIG'])
detection_model = model_builder.build(model_config=configs['model'], is_training=False)
# Restore checkpoint
ckpt = tf.compat.v2.train.Checkpoint(model=detection_model)
ckpt.restore(os.path.join(paths['CHECKPOINT_PATH'], 'ckpt-54.index')).expect_partial() # *** Replace the number in 'ckpt-XX' with the checkpoint you want to use. ***
```


### Relevant log output

```shell
ValueError                                Traceback (most recent call last)
Cell In[18], line 2
      1 # Restore checkpoint
----> 2 ckpt = tf.compat.v2.train.Checkpoint(model=detection_model)
      3 ckpt.restore(os.path.join(paths['CHECKPOINT_PATH'], 'ckpt-54.index')).expect_partial()

File ~\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\checkpoint\checkpoint.py:2142, in Checkpoint.__init__(self, root, **kwargs)
   2140 if isinstance(converted_v, weakref.ref):
   2141   converted_v = converted_v()
-> 2142 _assert_trackable(converted_v, k)
   2144 if root:
   2145   # Make sure that root doesn't already have dependencies with these names
   2146   child = trackable_root._lookup_dependency(k)

File ~\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\checkpoint\checkpoint.py:1562, in _assert_trackable(obj, name)
   1559 def _assert_trackable(obj, name):
   1560   if not isinstance(
   1561       obj, (base.Trackable, def_function.Function)):
-> 1562     raise ValueError(
   1563         f"`Checkpoint` was expecting {name} to be a trackable object (an "
   1564         f"object derived from `Trackable`), got {obj}. If you believe this "
   1565         "object should be trackable (i.e. it is part of the "
   1566         "TensorFlow Python API and manages state), please open an issue.")

ValueError: `Checkpoint` was expecting model to be a trackable object (an object derived from `Trackable`), got <object_detection.meta_architectures.ssd_meta_arch.SSDMetaArch object at 0x000001E163D93910>. If you believe this object should be trackable (i.e. it is part of the TensorFlow Python API and manages state), please open an issue.
```
