Error in minibatchqueue (line 290) numVariables = numel(getP​reviewFrom​Datastore(​originalDa​tastore));

3 views (last 30 days)
Hi,
I get this error :
------
Error in minibatchqueue (line 290)
numVariables = numel(getPreviewFromDatastore(originalDatastore));
Error in ourmodel (line 32)
mbqLDTrain = minibatchqueue(imdsLDTrain,MiniBatchSize=miniBatchSize, ...
------
Part of the code:
miniBatchSize = 1;
mbqLDTrain = minibatchqueue(imdsLDTrain,MiniBatchSize=miniBatchSize, ...
MiniBatchFormat="SSCB",DispatchInBackground=canUseGPU);
mbqHDTrain = minibatchqueue(imdsHDTrain,MiniBatchSize=miniBatchSize, ...
MiniBatchFormat="SSCB",DispatchInBackground=canUseGPU);
My matlab is R2021a version with Deep Learning Toolbox.
How do i fix this error ?
Thank You
  9 Comments
Abu Yusuf
Abu Yusuf on 18 Apr 2022
Invalid transform function defined on datastore.
The cause of the error was:
Undefined function 'augmentDataForLD2HDCT' for input arguments of type 'double'.
Error in @(x)augmentDataForLD2HDCT(x,inputSize)
Error in matlab.io.datastore.TransformedDatastore/applyTransforms (line 607)
data = ds.Transforms{ii}(data);
Error in matlab.io.datastore.TransformedDatastore/read (line 222)
[data, info] = ds.applyTransforms(data, info);
Error in matlab.io.datastore.TransformedDatastore/preview (line 292)
dataFromRead = read(copyds);
Error in getPreviewFromDatastore (line 9)
previewData = preview(inputDatastore);
Error in minibatchqueue (line 290)
numVariables = numel(getPreviewFromDatastore(originalDatastore));
Joss Knight
Joss Knight on 18 Apr 2022
Great! So there's your answer. When you modified this example you presumably forgot to copy over the accompanying file augmentDataForLD2HDCT.m.

Sign in to comment.

Accepted Answer

Joss Knight
Joss Knight on 18 Apr 2022
Make sure the accompanying file augmentDataForLD2HDCT.m that comes with this example is on the path when you run your code.
  9 Comments
Joss Knight
Joss Knight on 21 Apr 2022
Well, that explains it. That example didn't exist in R2021a and doesn't work with it. Either upgrade MATLAB, or look for an example in the archive documentation that will work and which you can adapt for your purposes: https://www.mathworks.com/help/releases/R2021a/deeplearning/examples.html

Sign in to comment.

More Answers (0)

Categories

Find more on Aerospace Applications in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!