{
  "id": "tensorflow/out-of-range-end-of-sequence",
  "signature": "OutOfRangeError: End of sequence",
  "signature_zh": "OutOfRangeError: 序列结束",
  "regex": "OutOfRangeError: End of sequence",
  "domain": "tensorflow",
  "category": "data_error",
  "subcategory": null,
  "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.",
  "root_cause_type": "generic",
  "root_cause_zh": "tf.data 迭代器在训练循环预期结束前已耗尽，通常是由于数据集大小与步数不匹配。",
  "versions": [
    {
      "version": "tensorflow 2.9.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "tensorflow 2.10.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "tensorflow 2.11.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This does not fix the mismatch; it only changes the number of elements per step.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "An infinite repeat (repeat()) can mask the error but leads to infinite loops if not handled.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "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`.",
      "success_rate": 0.95,
      "how": "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`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "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`."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.tensorflow.org/api_docs/python/tf/data/Dataset",
  "official_doc_section": null,
  "error_code": "EOS",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-04-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}