Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
how to choose specific GPUs on multi-GPUs server to train my CNN?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Our lab has a server with 8 GPUs(0,1,2,...,7),I want to choose No.1 and No.3 GPUs to train my CNN,how to do? The code is shown below.thanks
clear
trainingData = imageDatastore('C:\Users\Administrator\Desktop\matlab code\Training',... 'IncludeSubfolders',true,'LabelSource','foldernames');
testData = imageDatastore('C:\Users\Administrator\Desktop\matlab code\Test',... 'IncludeSubfolders',true,'LabelSource','foldernames');
layers = [ ... imageInputLayer([227 227 3]) convolution2dLayer(5,8) reluLayer() maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(5,48)
reluLayer()
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(5,48)
reluLayer()
dropoutLayer('Name','drop1')
fullyConnectedLayer(2)
softmaxLayer()
classificationLayer()];
options = trainingOptions('sgdm',...
'InitialLearnRate',0.0001,...
'MiniBatchSize',16,...
'MaxEpoch',1,...
'ExecutionEnvironment','multi-gpu')
net = trainNetwork(trainingData,layers,options);
YTest = classify(net,testData);
TTest = testData.Labels;
accuracy = sum(YTest == TTest)/numel(TTest)
0 comentarios
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!