How to copy the images from GPU to CPU more efficiently?
Open
Nobody has claimed this yet.
enhancement
external contribution welcome
- Dominant language
- C++
- Stars
- 5.8k
- Forks
- 678
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 27
Description
I want to feed the images to keras with dali's preprocessing pipeline. So I have to transform the gpu tensor to array at first. The code is:
x, y = pipe.run()
x = x.as_cpu().as_array()
y = y.as_cpu().as_array()
But it is very slow and about 200-300 images per second. Is there a faster way?
Thanks!
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
Start with the issue's pipe.run(), as_cpu(), and as_array() calls, then investigate where the GPU-to-CPU transfer and array conversion spend time. Compare the current path with any documented DALI integration for Keras and define done as a faster, benchmarked way to provide the images to the training pipeline.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- machine-learning, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100