Unable to save model when using EfficientNetB0
Hi @Seferovic8 ,

The issue resolved in TF2.13v. Please refer to attached [gist](https://colab.sandbox.google.com/gist/SuryanarayanaY/dbdb3fc33d50e28dc9dc5093ddc7ae77/61366.ipynb) and may test yourself. Since it is resolved in latest version its unlikely to cherry pick for TF2.12 version. Thank you, this works for me. 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/61366">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/61366">No</a>
 Yes

On Tue, 25 Jul 2023 at 16:41, google-ml-butler[bot] <
***@***.***> wrote:

> Are you satisfied with the resolution of your issue?
> Yes
> <https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/61366>
> No
> <https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/61366>
>
> —
> Reply to this email directly, view it on GitHub
> <https://github.com/tensorflow/tensorflow/issues/61366#issuecomment-1649975456>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AP67UQMQM5KVXEQMSSPJVO3XR7LH3ANCNFSM6AAAAAA2V3OBRU>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.***>
>

### Issue type

Bug

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

Yes

### Source

source

### TensorFlow version

2.12.0

### Custom code

Yes

### OS platform and distribution

_No response_

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

I’m trying to use EfficientNetB0 to create a model and save the model to my local disk. However, when saving it, it throws the error below.

> TypeError: Unable to serialize [2.0896919 2.1128857 2.1081853] to JSON. Unrecognized type <class 'tensorflow.python.framework.ops.EagerTensor'>.

Also, I tried to downgrade tensorflow from V2.12.0 to V2.9.1, this works as expected. In other words, this is a bug in 2.12.0. Hope it helps and please fix this bug for V2.12.0

### Standalone code to reproduce the issue

```shell
model = tf.keras.applications.EfficientNetB0()
model.save("model")
```


### Relevant log output

```shell
TypeError: Unable to serialize [2.0896919 2.1128857 2.1081853] to JSON. Unrecognized type <class 'tensorflow.python.framework.ops.EagerTensor'>.
```
