I'm getting error in deep convolution neural networks

1 vue (au cours des 30 derniers jours)
Maruthi Maruthi
Maruthi Maruthi le 17 Mar 2018
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.

Réponses (0)

Catégories

En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by