Hi,
%Train Network pixelRange = [-30 30]; scaleRange = [0.9 1.1]; imageAugmenter = imageDataAugmenter( ... 'RandXReflection',true, ... 'RandXTranslation',pixelRange, ... 'RandYTranslation',pixelRange, ... 'RandXScale',scaleRange, ... 'RandYScale',scaleRange); augimdsTrain = augmentedImageDatastore(inputSize(1:2),imdsTrain, ... 'DataAugmentation',imageAugmenter); augimdsValidation = augmentedImageDatastore(inputSize(1:2),imdsValidation); %Specify the training options. miniBatchSize = 10; valFrequency = floor(numel(imdsValidation.Files)/miniBatchSize); %%valFrequency = floor(numel(augimdsTrain.Files)/miniBatchSize); options = trainingOptions('sgdm', ... 'MiniBatchSize',miniBatchSize, ... 'MaxEpochs',6, ... 'InitialLearnRate',3e-4, ... 'Shuffle','every-epoch', ... 'ValidationData',augimdsValidation, ... 'ValidationFrequency',valFrequency, ... 'Verbose',false, ... 'Plots','training-progress');
I check inside of "augimdsTrain", there is no "Files". When I replace with the "valFrequency = floor(numel(augimdsTrain.Files)/miniBatchSize);" with "valFrequency = floor(numel(imdsValidation.Files)/miniBatchSize)" . "valFrequency = floor(numel(augimdsTrain.Files)/miniBatchSize);" It seems to work.
ANSWER
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
Hack way: old_warning_state = warning('off', 'MATLAB:structOnObject');
temp = struct(augimdsValidation);
warning(old_warning_state);
valFrequency = floor(numel(temp.DatastoreInternal.Files)/miniBatchSize);
SEE COMPLETE ANSWER CLICK THE LINK
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
old_warning_state = warning('off', 'MATLAB:structOnObject'); temp = struct(augimdsValidation); warning(old_warning_state); valFrequency = floor(numel(temp.DatastoreInternal.Files)/miniBatchSize);
SEE COMPLETE ANSWER CLICK THE LINK
Comments
Post a Comment