WARNING:tensorflow:Your input ran out of data; interrupting training always occuring after 80% of total epochs
@sushreebarsa I have already tried steps_per_epoch = (len(train_size) // batch_size) - 1. It gives the same error, just slightly later than the run with the calculation as (len(train_size)//batch_size).  @wzhou789 Could you please ensure that your data is shuffled before being fed to the model during training. Shuffling randomizes the order of data points within each batch and across epochs.
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. Hi @wzhou789 ,

Shuffling may not help in repetetion of data. If you are using tf.dataset repeat() function might help. 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/64476">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/64476">No</a>

### Issue type

Bug

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

No

### Source

source

### TensorFlow version

2.15

### Custom code

Yes

### OS platform and distribution

_No response_

### Mobile device

_No response_

### Python version

3.10.12

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

While I'm training a tensorflow model, the training keeps gets interrupted at the epoch after completing 80% of the total number of epochs I specified to train for. For example, it will stop training at epoch 81 if I had set epochs to 100, with the warning "WARNING:tensorflow:Your input ran out of data; interrupting training. Make sure that your dataset or generator can generate at least `steps_per_epoch * epochs` batches". 
I calculated steps_per_epoch as len(train_size) // batch_size. I have also tried using (len(train_size)//batch_size)-1. Both of these continue to cause the error specified above. I have also tried to leave out steps_per_epoch, which causes the model to start training with the validation steps per epoch instead. 

### Standalone code to reproduce the issue

```shell
https://colab.research.google.com/drive/1zNuEKH-K9pip9UonoOZC_2a1T5KdHFt7?usp=sharing
```


### Relevant log output

```shell
Epoch 300: val_loss did not improve from 1.24497
149/149 [==============================] - 13s 87ms/step - loss: 0.3701 - val_loss: 1.9121
Epoch 301/376
149/149 [==============================] - ETA: 0s - loss: 0.3454
Epoch 301: val_loss did not improve from 1.24497
149/149 [==============================] - 13s 85ms/step - loss: 0.3454 - val_loss: 3.6483
Epoch 302/376
149/149 [==============================] - ETA: 0s - loss: 0.3932
Epoch 302: val_loss did not improve from 1.24497
149/149 [==============================] - 13s 85ms/step - loss: 0.3932 - val_loss: 1.7741
Epoch 303/376
122/149 [=======================>......] - ETA: 1s - loss: 0.3708WARNING:tensorflow:Your input ran out of data; interrupting training. Make sure that your dataset or generator can generate at least `steps_per_epoch * epochs` batches (in this case, 56024 batches). You may need to use the repeat() function when building your dataset.
```
