EOS
tensorflow
data_error
ai_generated
true
OutOfRangeError: End of sequence
ID: tensorflow/out-of-range-end-of-sequence
90%Fix Rate
88%Confidence
1Evidence
2023-04-20First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| tensorflow 2.9.0 | active | — | — | — |
| tensorflow 2.10.0 | active | — | — | — |
| tensorflow 2.11.0 | active | — | — | — |
Root Cause
A tf.data iterator was exhausted before the training loop expected, often due to a mismatch between dataset size and number of steps.
generic中文
tf.data 迭代器在训练循环预期结束前已耗尽,通常是由于数据集大小与步数不匹配。
Official Documentation
https://www.tensorflow.org/api_docs/python/tf/data/DatasetWorkarounds
-
95% success Ensure the dataset is repeated or the number of steps matches the dataset size. For example: `dataset = dataset.repeat()` and then `steps_per_epoch = len(dataset) // batch_size`.
Ensure the dataset is repeated or the number of steps matches the dataset size. For example: `dataset = dataset.repeat()` and then `steps_per_epoch = len(dataset) // batch_size`.
中文步骤
Ensure the dataset is repeated or the number of steps matches the dataset size. For example: `dataset = dataset.repeat()` and then `steps_per_epoch = len(dataset) // batch_size`.
Dead Ends
Common approaches that don't work:
-
85% fail
This does not fix the mismatch; it only changes the number of elements per step.
-
90% fail
An infinite repeat (repeat()) can mask the error but leads to infinite loops if not handled.