How could i train my network on GPU?

1 回表示 (過去 30 日間)
Hind Haboubi
Hind Haboubi 2021 年 4 月 24 日
コメント済み: Hind Haboubi 2021 年 4 月 28 日
Hello guys, this is my code and i don't know how to train it on single GPU? Can you help me please. i have download GPU Coder ut i don't know what to do with it?
imageSize = [224 224 3];
load Damagevehicle
numClasses = 1;
anchorBoxes = [
43 59
18 22
23 29
84 109
];
base = resnet50;
inputlayer = base.Layers(1);
middle = base.Layers(2:174);
finallayer = base.Layers(174:end);
baseNetwork = [inputlayer
middle
finallayer];
featureLayer = 'activation_40_relu';
lgraph = yolov2Layers(imageSize,numClasses,anchorBoxes,base,featureLayer);
options = trainingOptions('sgdm','MiniBatchSize',128,'InitialLearnRate',1e-3,'MaxEpochs',1,'CheckpointPath',tempdir,...
'Shuffle','every-epoch','ExecutionEnvironment','auto');
damageDataset = ddd;
[detector,info] = trainYOLOv2ObjectDetector(damageDataset,lgraph,options);

採用された回答

Tarunbir Gambhir
Tarunbir Gambhir 2021 年 4 月 27 日
編集済み: Tarunbir Gambhir 2021 年 4 月 27 日
For training the network on a single particular GPU, you can select that GPU before you start the training and set the 'ExecutionEnvironment' as 'gpu' in trainingOptions(). You can refer this documentation for further information.
  1 件のコメント
Hind Haboubi
Hind Haboubi 2021 年 4 月 28 日
Thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by