Cache vs Prefetch: Choosing tf.data Dataset.cache() or Dataset.prefetch() for Limited Host RAM
Goal Determine the most appropriate tf.data strategy for a training pipeline that must reuse the same data across multiple epochs while staying within a constrained host RAM budget. Constraints & Uncertainty Host RAM is limited to 4 GB , but the dataset contains many large images, so in‑memory caching may be costly. Each epoch repeats the same examples,