tensorflow:Entity <function Function._initialize_uninitialized_variables.<locals>.initialize_variables at 0x000001F58F9464C8> could not be transformed and will be executed as-is.
@ShayanDodge,
Tensorflow 2.0 which you are using is pretty old. I suggest trying to use tensorflow latest stable versions 2.15 or 2.16 where the warning was not displayed while executing the above mentioned code. Kindly find the gist of it [here](https://colab.research.google.com/gist/tilakrayal/c9b3cc5ad4ca88cffedac481e43bc27a/untitled1789.ipynb) and also screenshot of the windows for the reference. Thank you!

<details><summary>Windows ScreeShot</summary> 

![64840](https://github.com/tensorflow/tensorflow/assets/81610181/a5e1b2a9-239f-4d42-8e51-356148b57919)
 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/64840">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/64840">No</a>

### Issue type

Bug

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

Yes

### Source

source

### TensorFlow version

tf 2.0.0

### Custom code

Yes

### OS platform and distribution

Windows 11

### Mobile device

_No response_

### Python version

3.7.12

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

The code should be executed without any warnings.





### Standalone code to reproduce the issue

```shell
# Training a neural network on Fashion MNIST using ℓ2 Regularization

# Importing essential package
import numpy as np
import tensorflow as tf
from tensorflow import keras
import matplotlib.pyplot as plt

# Loading Fashion MNIST dataset and preprocessing
(X_train_full, y_train_full), (X_test, y_test) = keras.datasets.fashion_mnist.load_data()
# Scaling pixel values to the range [0, 1]
X_train_full = X_train_full / 255.0
X_test = X_test / 255.0
# Splitting training set into validation and training subsets
X_valid, X_train = X_train_full[:5000], X_train_full[5000:]
y_valid, y_train = y_train_full[:5000], y_train_full[5000:]
# Calculating mean and standard deviation of training pixel values
pixel_means = X_train.mean(axis=0, keepdims=True)
pixel_stds = X_train.std(axis=0, keepdims=True)
# Standardizing the input features using mean and standard deviation
X_train_scaled = (X_train - pixel_means) / pixel_stds
X_valid_scaled = (X_valid - pixel_means) / pixel_stds
X_test_scaled = (X_test - pixel_means) / pixel_stds

# Setting random seeds for reproducibility
tf.random.set_seed(42)
np.random.seed(42)

# Creating a Sequential model
model = keras.models.Sequential([
    # Input layer: Flatten layer to convert 2D input (28x28) to 1D array
    keras.layers.Flatten(input_shape=[28, 28]),
    # Hidden layer 1: Dense layer with 300 neurons, ELU activation function,
    # He initialization, and ℓ2 regularization with a regularization strength of 0.01
    keras.layers.Dense(300, activation="elu",
                       kernel_initializer="he_normal",
                       kernel_regularizer=keras.regularizers.l2(0.01)),
    # Hidden layer 2: Dense layer with 100 neurons, ELU activation function,
    # He initialization, and ℓ2 regularization with a regularization strength of 0.01
    keras.layers.Dense(100, activation="elu",
                       kernel_initializer="he_normal",
                       kernel_regularizer=keras.regularizers.l2(0.01)),
    # Output layer: Dense layer with 10 neurons (for 10 classes), softmax activation function,
    # and ℓ2 regularization with a regularization strength of 0.01
    keras.layers.Dense(10, activation="softmax",
                       kernel_regularizer=keras.regularizers.l2(0.01))
])

# Compiling the model
model.compile(loss="sparse_categorical_crossentropy", optimizer="nadam", metrics=["accuracy"])

# Defining number of epochs
n_epochs = 2

# Training the model
history = model.fit(X_train_scaled, y_train, epochs=n_epochs,
                    validation_data=(X_valid_scaled, y_valid))
```


### Relevant log output

```shell
Train on 55000 samples, validate on 5000 samples
Epoch 1/2
WARNING:tensorflow:Entity <function Function._initialize_uninitialized_variables.<locals>.initialize_variables at 0x000001F58F9464C8> could not be transformed and will be executed as-is. Please report this to the AutoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: No module named 'tensorflow_core.estimator'
WARNING: Entity <function Function._initialize_uninitialized_variables.<locals>.initialize_variables at 0x000001F58F9464C8> could not be transformed and will be executed as-is. Please report this to the AutoGraph team. When filing the bug, set the verbosity to 10 (on Linux, `export AUTOGRAPH_VERBOSITY=10`) and attach the full output. Cause: No module named 'tensorflow_core.estimator'
55000/55000 [==============================] - 5s 95us/sample - loss: 1.6073 - accuracy: 0.8114 - val_loss: 0.7551 - val_accuracy: 0.8054
Epoch 2/2
55000/55000 [==============================] - 4s 80us/sample - loss: 0.7145 - accuracy: 0.8279 - val_loss: 0.7187 - val_accuracy: 0.8230
```
