bug feedback
@wangdadaba 
I was able to execute a given code without error on colab using TF v2.11 & TF v2.8. `model(x, training = fasle)` and `model.predict()` getting the same results. Could you please confirm the same and find the gist of [2.11](https://colab.research.google.com/gist/tiruk007/fa278bcb3c0c182fea74d9c0c983fa80/untitled155.ipynb) and [2.8](https://colab.research.google.com/gist/tiruk007/368f56317e9a51d878807532a189659a/untitled156.ipynb) for reference.

Thank you ! 我猜测可能是gpu得问题，我关闭了gpu进行测试结果是正确的，当我开启了gpu之后，结果仍然有问题。我使用的是docker容器，网址https://catalog.ngc.nvidia.com/orgs/nvidia/containers/tensorflow/tags 
nvcr.io/nvidia/tensorflow:22.04-tf2-py3 .



> @wangdadaba I was able to execute a given code without error on colab using TF v2.11 & TF v2.8. `model(x, training = fasle)` and `model.predict()` getting the same results. Could you please confirm the same and find the gist of [2.11](https://colab.research.google.com/gist/tiruk007/fa278bcb3c0c182fea74d9c0c983fa80/untitled155.ipynb) and [2.8](https://colab.research.google.com/gist/tiruk007/368f56317e9a51d878807532a189659a/untitled156.ipynb) for reference.
> 
> Thank you !
I guessed that there might be a problem with the GPU, I turned off the GPU to test correctly, and when I turned on the GPU, the results are still problematic. I'm using a docker container with URLs ：https://catalog.ngc.nvidia.com/orgs/nvidia/containers/tensorflow/tags 
taf：nvcr.io/nvidia/tensorflow:22.04-tf2-py3 .


 @wangdadaba 
I was able to get similar results on the GPU as well  on Colab using tf2.11. Please find the gist [here](https://colab.research.google.com/gist/tiruk007/ee2704d70bbe51f4ecd45e429cbd7a83/untitled161.ipynb) 

Could you please try the latest docker container(nvcr.io/nvidia/tensorflow:23.02-tf2-py3) and let us know if it still persists.

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/60007">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/60007">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

tf2.8

### 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 Behaviour?

```shell
A bug happened!
The code and results can be seen specifically. When I use model(x, training = fasle) and model.predict(), the results of the first few times are always wrong, and the reason cannot be found.You will find that the code that runs for the first time is always wrong. I did this test because I was using model(img, training = False) and model.predict() to get different results. Later, it was verified that it was the first few times There will be errors, and it will be normal in the future.
```


### Standalone code to reproduce the issue

```shell
import tensorflow as tf
import numpy as np
from tensorflow.keras.layers import (Activation, BatchNormalization,Dense, Flatten, Conv2D ,Input,
                                     Concatenate, Conv2D, Dense, Dropout,
                                     GlobalAveragePooling2D, Lambda,
                                     MaxPooling2D, add)
from tensorflow.keras.models import Model
img = np.random.random((1,112,112,3))

def create_model():
  model = tf.keras.Sequential([
      tf.keras.layers.Conv2D(32, 3, activation='relu'),
      tf.keras.layers.MaxPooling2D(),
      tf.keras.layers.Conv2D(64, 3, activation='relu'),
      tf.keras.layers.MaxPooling2D(),
      tf.keras.layers.Conv2D(128, 1, activation='relu'),
      tf.keras.layers.MaxPooling2D(),
      tf.keras.layers.Flatten(),
      tf.keras.layers.Dense(64, activation='relu'),
      tf.keras.layers.Dense(10)
    ])

  return model


input_shape     = [112, 112, 3]
inputs = Input(shape=input_shape)
model = create_model()

for i in range(5):
    print(model.predict(img)[0][0:10])
# or run up core ------------------------

@tf.function
def test_step():
    return model(img,training = False)
for i in range(5):
    print(test_step()[0][0:10])
```


### Relevant log output

```shell
[ 0.13942198  0.16932502 -0.00587191 -0.03490476 -0.05865425 -0.10204756
  0.02883459 -0.06782953 -0.17910798  0.10979672]
[ 0.13943174  0.16934936 -0.00590273 -0.03488521 -0.05866342 -0.10207407
  0.02890574 -0.06792954 -0.1791203   0.10971892]
[ 0.13942198  0.16932502 -0.00587191 -0.03490476 -0.05865425 -0.10204756
  0.02883459 -0.06782953 -0.17910798  0.10979672]
[ 0.13942198  0.16932502 -0.00587191 -0.03490476 -0.05865425 -0.10204756
  0.02883459 -0.06782953 -0.17910798  0.10979672]
[ 0.13942198  0.16932502 -0.00587191 -0.03490476 -0.05865425 -0.10204756
  0.02883459 -0.06782953 -0.17910798  0.10979672]

up result------------------------


tf.Tensor(
[ 0.33203632 -0.11037838  0.13731733 -0.01554211  0.212542   -0.13555858
  0.21057142  0.2515831  -0.16747513  0.2777309 ], shape=(10,), dtype=float32)
tf.Tensor(
[ 0.33203542 -0.1103816   0.13731548 -0.01554125  0.21254522 -0.13556004
  0.21057592  0.25158295 -0.16747653  0.27773613], shape=(10,), dtype=float32)
tf.Tensor(
[ 0.3320552  -0.11031806  0.1372948  -0.01558295  0.21247748 -0.13555783
  0.21053793  0.25155216 -0.16746978  0.27769867], shape=(10,), dtype=float32)
tf.Tensor(
[ 0.33203542 -0.1103816   0.13731548 -0.01554125  0.21254522 -0.13556004
  0.21057592  0.25158295 -0.16747653  0.27773613], shape=(10,), dtype=float32)
tf.Tensor(
[ 0.33203542 -0.1103816   0.13731548 -0.01554125  0.21254522 -0.13556004
  0.21057592  0.25158295 -0.16747653  0.27773613], shape=(10,), dtype=float32)
```
</details>