Cannot save model when not giving a name in Layer.add_weight call in "build"
Hi @Mastiff37 Thanks for reporting this issue.

I was able to reproduce this issue on TF Nightly 2.13.0-dev20230313 as well. Please find the gist [here](https://colab.research.google.com/gist/pjpratik/ae1b620bd93ebfff636632a6add7f1a8/59954.ipynb).

The workaround is to add name to the layer.

@SuryanarayanaY  could you please look into this? `The build()` method’s role is to create the layer’s variables by calling the `add_weight()`
 method for each weight. The `build()` method is called the first time the layer is used.
 At that point, Keras will know the shape of this layer’s inputs, and it will pass it to the `build()` method.
The constructor uses the `add_weight()` method to create the variables which will be used to track the operations used further.
It is. suggested to pass the name to the `add_weight()` method else as you see in the error message it fails in the below condition.
https://github.com/tensorflow/tensorflow/blob/f8163bd5bb373d622a69672eb3bdfd087c9bb5d7/tensorflow/python/trackable/trackable_utils.py#L120-L127 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/59954">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/59954">No</a>

I have the identical issue to https://github.com/tensorflow/tensorflow/issues/36962, except I'm on 2.11.0.  Was it really resolved?

The issue is that the model will not save and returns: `AttributeError: 'NoneType' object has no attribute 'replace'`

It would have taken a very long time to run this down if I hadn't found the linked issue, but I also have `self.add_weight` in a custom layer with no name.