I'm getting error in deep convolution neural networks

조회 수: 1 (최근 30일)
Maruthi Maruthi
Maruthi Maruthi 2018년 3월 17일
편집: Maruthi Maruthi 2018년 3월 17일
Sir, I'm getting error by using the above code.
filename=['D:\MATLAB\R2017a\bin\Deep Learning\imgs'];
imds = imageDatastore(filename,...
'IncludeSubfolders',true,...
'LabelSource','foldernames');
imds.ReadFcn = @(filename)readAndPreprocessImage(filename);
[imdsTrain,imdsTest] = splitEachLabel(imds,0.7,'randomized');
numTrainImages = numel(imdsTrain.Labels);
net = alexnet;
net.Layers
inputSize = net.Layers(1).InputSize
%augimdsTrain = augmentedImageDatastore(inputSize(1:2),imdsTrain);
%TaugimdsTest = augmentedImageDatastore(inputSize(1:2),imdsTest);
label=classify(net,imdsTest)
function Iout = readAndPreprocessImage(filename)
I = imread(filename);
% Some images may be grayscale. Replicate the image 3 times to
% create an RGB image.
if ismatrix(I)
I = cat(3,I,I,I);
end
% Resize the image as required for the CNN.
Iout = imresize(I, [227 227]);
end
My error is Struct contents reference from a non-struct array object. Please resolve the issue as early as possible.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by