【问题标题】:CUDA Error - Semantic SegmentationCUDA 错误 - 语义分割
【发布时间】:2018-03-18 18:00:58
【问题描述】:

使用语义分割,我想将卫星图像分为两类:waterland。我遇到了这个问题:

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)

我该如何解决这个问题?

【问题讨论】:

    标签: matlab image-processing deep-learning image-segmentation


    【解决方案1】:

    gpuDevice()

    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
    

    【讨论】:

      【解决方案2】:

      看起来像是某种 CUDA 设置问题。什么是输出:

      gpuDevice()
      

      【讨论】:

        猜你喜欢
        • 2018-01-12
        • 2021-07-19
        • 2020-05-03
        • 1970-01-01
        • 1970-01-01
        • 2012-11-29
        • 2021-02-19
        • 1970-01-01
        • 2014-06-06
        相关资源
        最近更新 更多