Hope this information helps those who want to train their own mask R-CNN on MATLAB.
Error executing of the example code for training a custom Mask R-CNN using cocodataset 2014
iteration = 1; start = tic; % Create subplots for the learning rate and mini-batch loss fig = figure; [lossPlotter] = helper.configureTrainingProgressPlotter(fig); % Initialize verbose output helper.initializeVerboseOutput([]); % Custom training loop for epoch = 1:numEpochs reset(mbqTrain) shuffle(mbqTrain) while hasdata(mbqTrain) % Get next batch from minibatchqueue [X,gtBox,gtClass,gtMask] = next(mbqTrain); % Evaluate the model gradients and loss using dlfeval [gradients,loss,state] = dlfeval(@networkGradients,X,gtBox,gtClass,gtMask,dlnet,params); dlnet.State = state; % Compute the learning rate for the current iteration learnRate = initialLearnRate/(1 + decay*iteration); if(~isempty(gradients) && ~isempty(loss)) [dlnet.Learnables,velocity] = sgdmupdate(dlnet.Learnables,gradients,velocity,learnRate,momentum); else continue; end helper.displayVerboseOutputEveryEpoch(start,learnRate,epoch,iteration,loss); % Plot loss/accuracy metric D = duration(0,0,toc(start),'Format','hh:mm:ss'); addpoints(lossPlotter,numdetectMaskRCNN,Iteration,double(gather(extractdata(loss)))) subplot(2,1,2) title(strcat("Epoch: ",num2str(epoch),", Elapsed: "+string(D))) drawnow iteration = iteration + 1; end end net = dlnet; % Save the trained network modelDateTime = string(datetime('now','Format',"yyyy-MM-dd-HH-mm-ss")); save(strcat("trainedMaskRCNN-",modelDateTime,"-Epoch-",num2str(numEpochs),".mat"),'net');
[gradients,loss,state] = dlfeval(@networkGradients,X,gtBox,gtClass,gtMask,dlnet,params); dlnet.State = state;
idx = dlnet.State.Parameter == "TrainedVariance"; boundAwayFromZero = @(X) max(X, eps('single')); dlnet.State(idx,:) = dlupdate(boundAwayFromZero, dlnet.State(idx,:));
Name: 'prashant 1080' Index: 1 ComputeCapability: '6.1' SupportsDouble: 1 DriverVersion: 11.2000 ToolkitVersion: 11 MaxThreadsPerBlock: 1024 MaxShmemPerBlock: 49152 MaxThreadBlockSize: [1024 1024 64] MaxGridSize: [2.1475e+09 65535 65535] SIMDWidth: 32 TotalMemory: 8.5899e+09 AvailableMemory: 7.4505e+09 MultiprocessorCount: 20 ClockRateKHz: 1771000 ComputeMode: 'Default' GPUOverlapsTransfers: 1 KernelExecutionTimeout: 1
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.