tensorflow / tensorflow/datasets

Is Dataset for small in memory data slower?

Open
#3,065 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.