Bitte ich brauche Hilfe bei der Verwendung von CNN auf Bildtraining. Ich benutze die 'praktische-cnn-2015a' Demo.Fehler beim CNN-Training
Im Folgenden finden Sie einen Auszug der Codes, die auf meine Arbeit angewendet wurden, und die Fehler, die mir aufgefallen sind. Bitte helfen Sie. Danke
%% Load image dataset
imgFolder1 = fullfile('C:\Users\Jay\Desktop\practical-cnn-2015a\NairaNotes');
trainingSet = imageSet(imgFolder1, 'recursive');
%%
for digit = 1:numel(trainingSet)
numImages = trainingSet(digit).Count;
for i = 1:numImages img = read(trainingSet(digit), i);
im = rgb2gray(im2single(read(trainingSet(digit), i)));
end
labels = repmat(trainingSet(digit).Description, numImages, 1);
end
%% Visualize some of the data
figure(10) ; clf ; colormap gray ;
subplot(1,2,1) ; vl_imarraysc(img) ;
axis image off ; title('training chars for ''a''') ; subplot(1,2,2) ;
vl_imarraysc(img); axis image off ;
title('validation chars for ''a''') ;
%% ------------------------------------------------------------------------- % Part 4.2: initialize a CNN architecture % -------------------------------------------------------------------------
net = initializeCharacterCNN() ;
%% % -------------------------------------------------------------------------
% Part 4.3: train and evaluate the CNN % -------------------------------------------------------------------------
trainOpts.batchSize = 100 ;
trainOpts.numEpochs = 15 ;
trainOpts.continue = true ;
trainOpts.useGpu = false ;
trainOpts.learningRate = 0.001 ;
trainOpts.expDir = (img) ;
%% ----------------------------------------------------------
%% i have errors in this section:
(attempt to execute SCRIPT varagin.m as a function)
trainOpts = vl_argparse(trainOpts, varargin(:));
%% --------------------------------------------
%% Take the average image out
imdb = img ;
imageMean = mean(imdb(:)) ;
imdb = imdb - imageMean ;
%% Convert to a GPU array if needed
if trainOpts.useGpu
imdb = gpuArray(imdb) ;
end
%% pending: Call training function in MatConvNet
[net,info] = cnn_train(net, imdb, @getBatch, trainOpts) ;
Fehler mit Full-File (Linie 61) ist ein unbekannter Fehler in Full-File aufgetreten, während die Dateispezifikation zu konstruieren.
Fehler in cnn_train (Zeile 92) modelFigPath = fullfile (opts.expDir, 'net-train.pdf');
Fehler in trainCNN2 (Zeile 72) [Netto, Info] = cnn_train (net, imdb, @getBatch, trainOpts); Caused by:
Fehler bei der Verwendung von horzcat Dimensionen von verketteten Matrizen sind nicht konsistent.