DispatchIn​Background​Datastore

1 view (last 30 days)
Nursara Ain Harzany
Nursara Ain Harzany on 26 Dec 2022
Answered: Amey Waghmare on 3 Jan 2023
I am following a documentation of Gesture Recognition using Videos and Deep Learning. Currently stuck at creating minibatches because of this error "Undefined function 'DispatchInBackgroundDatastore' for input arguments of type 'matlab.io.datastore.FileDatastore'."
The line is
datastore = DispatchInBackgroundDatastore(datastore, p.NumWorkers);
Tried looking up DispatchInBackgroundDatastore() function in matlab help, it seems like it nonexistent except in the video classification documentation. Where does this function come from?
function mbq = createMiniBatchQueue(datastore, numOutputs, params)
if params.DispatchInBackground && isempty(gcp('nocreate'))
% Start a parallel pool, if DispatchInBackground is true, to dispatch
% data i n the background using the parallel pool.
c = parcluster('local');
c.NumWorkers = params.NumWorkers;
parpool('local',params.NumWorkers);
end
p = gcp('nocreate');
if ~isempty(p)
datastore = DispatchInBackgroundDatastore(datastore, p.NumWorkers);
end

Answers (1)

Amey Waghmare
Amey Waghmare on 3 Jan 2023
Hi,
As per my understanding, you are facing an undefined function error for DispatchInBackgroundDatastore while following the example Gesture Recognition using Videos and Deep Learning.
‘DispatchInBackgroundDatastore’ is not a MATLAB function, but is provided as a part of this example, as mentioned in ‘Specify Training Options’ subsection of ‘Train a Video Classifier for Gesture Recognition’ section. In order to avoid the undefined function error, you can open the example in MATLAB by typing the following in the Command Window,
openExample('deeplearning_shared/GestureRecognitionUsingSlowFastVideoClassificationExample')
This will add the ‘DispatchInBackgroundDatastore’ to the path.

Community Treasure Hunt

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

Start Hunting!