How to prefetch data during network training ?

5 Ansichten (letzte 30 Tage)
Xie Shipley
Xie Shipley am 23 Nov. 2023
Bearbeitet: Venu am 25 Nov. 2023
Is there any method to prefetch data during network training In MATLAB?

Antworten (1)

Venu
Venu am 25 Nov. 2023
Yes you can prefetch your data while training the network in MATLAB if you have a GPU. While the GPU is working on the current mini-batch of data, the CPU can simultaneously prepare the next mini-batch, which helps reduce the time the GPU spends waiting for data.
To implement data prefetching in MATLAB, you can use the "backgroundDispatchEnable" property of the "miniBatchQueue" object. This property enables the loading and processing of data in the background while the GPU is training on the current batch.
You can refer to these documentations:
hope this helps
  2 Kommentare
Xie Shipley
Xie Shipley am 25 Nov. 2023
Yes, i have GPU.
I use `trainNetwork` with custom-mini-batch-datastore, and enbale `DispatchInBackground` in trainingOptions. But the Parallel Pool will not start automatically, Are there any steps I'm missing ?@Venu
Venu
Venu am 25 Nov. 2023
Bearbeitet: Venu am 25 Nov. 2023
Check with this MATLAB Answer and discussion.
Try checking Parallel Pooling preferences in Home Tab, "Automatically create a parallel pool" option should be checked.
You can also start a parallel pool manually before calling train network by using "parpool" function.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by