Borrar filtros
Borrar filtros

I'm getting error in deep convolution neural networks

2 visualizaciones (últimos 30 días)
Maruthi Maruthi
Maruthi Maruthi el 17 de Mzo. de 2018
Editada: Maruthi Maruthi el 17 de Mzo. de 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.

Respuestas (0)

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by