0
使用語義分割,我想將衛星圖像分爲兩類:water
和land
。我遇到此問題:CUDA錯誤 - 語義分割
CUDA執行期間發生意外錯誤。 CUDA的錯誤是:CUDA_ERROR_LAUNCH_FAILED
這裏是我的代碼:
clear;clc;close all
dataDir = fullfile('C:\Users\firat\Desktop\TEZ\Uygulama\Semantic
Segmentation\data');
imDir = fullfile(dataDir,'image');
pxDir = fullfile(dataDir,'imagePixelLabels');
imds = imageDatastore(imDir);
I = readimage(imds,1);
figure
imshow(I)
% imageLabeler(imDir);
classNames = ["Water" "Land"];
pixelLabelID = [1 2];
pxds = pixelLabelDatastore(pxDir,classNames,pixelLabelID);
C = readimage(pxds,1);
B = labeloverlay(I,C);
figure
imshow(B)
buildingMask = C == 'Water';
figure
imshowpair(I, buildingMask,'montage')
% Create a Semantic Segmentation Network
numFilters = 64;
filterSize = 3;
numClasses = 2;
layers = [
imageInputLayer([1024 1024 3])
convolution2dLayer(filterSize,numFilters,'Padding',1)
reluLayer()
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(filterSize,numFilters,'Padding',1)
reluLayer()
transposedConv2dLayer(4,numFilters,'Stride',2,'Cropping',1);
convolution2dLayer(1,numClasses);
softmaxLayer()
pixelClassificationLayer()
]
opts = trainingOptions('sgdm', ...
'InitialLearnRate', 1e-3, ...
'MaxEpochs', 100, ...
'MiniBatchSize', 64);
trainingData = pixelLabelImageSource(imds,pxds);
net = trainNetwork(trainingData,layers,opts);
testImage = imread('C:\Users\firat\Desktop\TEZ\Uygulama\Semantic
Segmentation\test\test3.tif');
C = semanticseg(testImage,net);
B = labeloverlay(testImage,C);
figure
imshow(B)
我怎樣才能解決這個問題?