I'm getting error in deep convolution neural networks
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!