Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how to choose specific GPUs on multi-GPUs server to train my CNN?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!