How to prefetch data during network training ?

Is there any method to prefetch data during network training In MATLAB?

답변 (1개)

Venu
Venu 2023년 11월 25일

0 개 추천

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

Xie Shipley
Xie Shipley 2023년 11월 25일
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 2023년 11월 25일
편집: Venu 2023년 11월 25일
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.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

릴리스

R2023a

질문:

2023년 11월 23일

편집:

2023년 11월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by