TypeError: _lookup_dependency() takes 2 positional arguments but 3 were given
Hi @ngbusca ,

I have tested the given code with tf-nightl(2.14.0-dev20230712)  and its working fine for me. I can able to save and reload the model. Could you please check the attached [gist](https://colab.research.google.com/gist/SuryanarayanaY/ebb5ad981552360fa1f04541248e7914/61265.ipynb) and let me know whether the code is right one to reproduce the reported behaviour.

Thanks! Hi @SuryanarayanaY 
Thanks for the response. Yes, the code is correct. I've downgraded to 2.13 and don't encounter the issue. I must have had an inconsistency on my system, I'll close the issue and reopen if I encounter it again. 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/61265">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/61265">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

2.14.0-dev20230712

### Custom code

Yes

### OS platform and distribution

Linux moe 5.10.0-12-amd64 #1 SMP Debian 5.10.103-1 (2022-03-07) x86_64 GNU/Linux

### Mobile device

_No response_

### Python version

3.9

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Can't load saved model

### Standalone code to reproduce the issue

```shell
Saved models can't be loaded:


model = tf.keras.models.Sequential([tf.keras.layers.Input((256,256,3)), tf.keras.layers.Dense(1)])
model.save("../models/test")
model = tf.keras.models.load_model("../models/test/")
```

same thing with more complex models

```
model = tf.keras.applications.efficientnet.EfficientNetB0()
model.save("../models/test")
model = tf.keras.models.load_model("../models/test/")
```
```


### Relevant log output

```shell
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[11], line 1
----> 1 model = tf.keras.models.load_model("../models/test/")

File ~/.local/lib/python3.9/site-packages/keras/src/saving/saving_api.py:262, in load_model(filepath, custom_objects, compile, safe_mode, **kwargs)
    254     return saving_lib.load_model(
    255         filepath,
    256         custom_objects=custom_objects,
    257         compile=compile,
    258         safe_mode=safe_mode,
    259     )
    261 # Legacy case.
--> 262 return legacy_sm_saving_lib.load_model(
    263     filepath, custom_objects=custom_objects, compile=compile, **kwargs
    264 )

File ~/.local/lib/python3.9/site-packages/keras/src/utils/traceback_utils.py:70, in filter_traceback.<locals>.error_handler(*args, **kwargs)
     67     filtered_tb = _process_traceback_frames(e.__traceback__)
     68     # To get the full stack trace, call:
     69     # `tf.debugging.disable_traceback_filtering()`
---> 70     raise e.with_traceback(filtered_tb) from None
     71 finally:
     72     del filtered_tb

File ~/.local/lib/python3.9/site-packages/tensorflow/python/checkpoint/restore.py:606, in _queue_children_for_restoration(checkpoint_position, visit_queue)
    604   continue
    605 child_position = checkpoint_position.create_child_position(child.node_id)
--> 606 local_object = trackable._lookup_dependency(child.local_name,
    607                                             trackable_children)
    608 child_proto = child_position.object_proto
    609 if local_object is None:
    610   # We don't yet have a dependency registered with this name. Save it
    611   # in case we do.

TypeError: _lookup_dependency() takes 2 positional arguments but 3 were given
```
