How could i train my network on GPU?
2 views (last 30 days)
Show older comments
Hind Haboubi on 24 Apr 2021
Commented: Hind Haboubi on 28 Apr 2021
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];
numClasses = 1;
anchorBoxes = [
base = resnet50;
inputlayer = base.Layers(1);
middle = base.Layers(2:174);
finallayer = base.Layers(174:end);
baseNetwork = [inputlayer
featureLayer = 'activation_40_relu';
lgraph = yolov2Layers(imageSize,numClasses,anchorBoxes,base,featureLayer);
options = trainingOptions('sgdm','MiniBatchSize',128,'InitialLearnRate',1e-3,'MaxEpochs',1,'CheckpointPath',tempdir,...
damageDataset = ddd;
[detector,info] = trainYOLOv2ObjectDetector(damageDataset,lgraph,options);
Tarunbir Gambhir on 27 Apr 2021
Edited: Tarunbir Gambhir on 27 Apr 2021
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.
More Answers (0)
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!