CUDA Error - Semantic Segmentation

조회 수: 12 (최근 30일)
Firat Erdem
Firat Erdem 2017년 10월 6일
답변: Joss Knight 2017년 10월 16일
Hello,
Using semantic segmentation, I want to separate the satellite image into two classes, water and land. I am having this problem: "An unexpected error occurred during CUDA execution. The CUDA error was: CUDA_ERROR_LAUNCH_FAILED"
How can I solve this problem ?
Here my codes :
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)
  댓글 수: 2
Sean de Wolski
Sean de Wolski 2017년 10월 6일
What's the output from?
>>gpuDevice
Firat Erdem
Firat Erdem 2017년 10월 6일
ans =
CUDADevice with properties:
Name: 'GeForce 840M'
Index: 1.00
ComputeCapability: '5.0'
SupportsDouble: 1
DriverVersion: 9.00
ToolkitVersion: 8.00
MaxThreadsPerBlock: 1024.00
MaxShmemPerBlock: 49152.00
MaxThreadBlockSize: [1024.00 1024.00 64.00]
MaxGridSize: [2147483647.00 65535.00 65535.00]
SIMDWidth: 32.00
TotalMemory: 2147483648.00
MultiprocessorCount: 3.00
ClockRateKHz: 1124000.00
ComputeMode: 'Default'
GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
CanMapHostMemory: 1
DeviceSupported: 1
DeviceSelected: 1

댓글을 달려면 로그인하십시오.

답변 (1개)

Joss Knight
Joss Knight 2017년 10월 16일
This is almost guaranteed to be due to a kernel time-out - your GPU is also driving your graphics, and Windows imposes a time-out on long-running kernels to prevent the graphics freezing up. Try setting the TdrLevel registry key to 0 to turn off the time-outs, and see if the problem goes away.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by