How to tune the hyperparameters of minibatch size to improve the training speed of CNN with 40 CPUs

조회 수: 3 (최근 30일)
Hello
I have a ubuntu server with 40 CPUs. I need to train a 5 depth CNN to train 285000 images. I set the minibatch size as 256 and epochs as 5 and the speed is very slow. It spent one day and haven't finished the training in epoch one.
Could I know how to improve the speed?
Thanks
  댓글 수: 1
Ke Zhang
Ke Zhang 2022년 4월 27일
Is increasing the minibatch to 1000 getting things better? I have searched some articles and it is said the image loading time would take very long. But I'm not sure what the image loading time point to? I thinkn I have used the imageDataStore to load my images.
Thanks

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

답변 (1개)

aditi bagora
aditi bagora 2023년 10월 12일
Hello Ke Zhang,
I understand you are currently training your CNN network on an Ubuntu server with multiple CPUs, and the training process is taking longer than expected.
To enhance the training speed, you can leverage the power of multiple CPUs using the hardware support provided in the “trainingOptions()”. By setting the ‘ExecutionEnvironment’ parameter to ‘parallel-cpu', you can make use of the available CPUs effectively.
Here's an example on how to set the ‘ExecutionEnvironment’ parameter:
% Set the option to use CPUs in parallel.
options = trainingOptions("sgdm", MiniBatchSize=256, ExecutionEnvironment="parallel-cpu");
Furthermore, since you mentioned using an ‘ImageDataStore’, it is important to ensure that your data store is partitionable and subsettable. These properties allow for efficient parallel distribution of the data across multiple CPUs. You can use the functions isPartitionable() and isSubsettable() to check whether your data store meets these requirements using the below syntax.
tf = isPartitionable(ds) % returns true if the datastore is partionable.
tf = isSubsettable(ds) % returns true if the datastore is subsettable.
For more details on ‘ExecutionEnvironment’, please refer to the following documentation links:
Hope the information helps!
Regards,
Aditi

카테고리

Help CenterFile Exchange에서 Recognition, Object Detection, and Semantic Segmentation에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by