tensorflow / tensorflow/datasets
Is Dataset for small in memory data slower?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 1.6k
- Avg merge
- 3h 54m
- Merged PRs (30d)
- 1
Description
Training on TPU I found that for small datasets (a few GB) that fit to memory it is faster to feed tf.tensors directly without creating a Dataset. The best result I managed to get using tf.data.Dataset is to convert "in memory" numpy data with from_tensor_slices then repeat, batch, prefetch.
Am I right that there is no need to use Dataset on "in memory" data? Or there is something else that makes tf.data.Dataset faster for such cases?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin with the reported comparison of direct tf.tensors and tf.data.Dataset.from_tensor_slices(...).repeat().batch().prefetch() on small in-memory data, then review TensorFlow input-pipeline guidance. Done means documenting whether Dataset is needed and under what conditions, supported by a reproducible benchmark; no repository file or test is named in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- data, machine-learning
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100