DEV Community

Rishit Dagli
Rishit Dagli

Posted on • Edited on • Originally published at twitter.com

2 1

đź’ˇTensorFlow Tip, use .prefetch

đź’ˇ #TensorFlowTip
Use .prefetch to reduce your step time of training and extracting data

  • overlap the preprocessing and model execution
  • while the model executes training step n the input pipeline is reading the data for n+1 step
  • reduces the idle time for the GPU and CPU

See the speedup with .prefetch in this image.

Try it for yourself:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
view raw prefetch.ipynb hosted with ❤ by GitHub

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

đź‘‹ Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay