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

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 个评论

Can you provide the error message? You've only provided the call stack.
That's not it Abu. I'm after the complete text of the error message - the red text shown in the command window that you're asking about.
There is more red text above this, you need show us all the red text.
If that's the case I can only assume you are using Live Script and the error message is stuck inside the live script window...or perhaps you're using Simulink? You see, every error comes with an error message (saying what the problem is) followed by the call stack (saying where the problem occurred). What you have given me is just the call stack. That makes it hard to diagnose your problem.
Let's try this: Please type the command that causes the error in the command window (not the editor), then copy-paste all the text output including the command you typed. The command that is erroring appears to be the following:
mbqLDTrain = minibatchqueue(imdsLDTrain,MiniBatchSize=miniBatchSize, ...
MiniBatchFormat="SSCB",DispatchInBackground=canUseGPU);
So type that, hit return, and then copy everything in the command window, including the above text, all the way down to the bottom, even if it doesn't fit on one screen, and paste it all here for us to look at. Thanks.
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));
Great! So there's your answer. When you modified this example you presumably forgot to copy over the accompanying file augmentDataForLD2HDCT.m.

请先登录,再进行评论。

 采纳的回答

Make sure the accompanying file augmentDataForLD2HDCT.m that comes with this example is on the path when you run your code.

9 个评论

"the accompanying file augmentDataForLD2HDCT.m that comes with this example"
Please, I don't know where to find it.. Can you check if it is on the example page.
Obviously you have to have the example open in MATLAB. I assumed you had done that otherwise how did you get the example running in the first place? You need to click on one of the big buttons at the top right of the example to open it in MATLAB. You can either open in MATLAB Online, or choose "Copy Command" and then run the openExample command in MATLAB:
openExample('images_deeplearning/UnsupervisedCTImageDenoisingUsingUNITExample')
Then you'll see the file augmentDataForLD2HDCT.m in your current folder.
Thanks for your help and patience.
This problem appeared
You probably don't have the Image Processing Toolbox, which seems to be required for this example. What is the output of the ver command?
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.10.0.1602886 (R2021a)
MATLAB License Number: 968398
Operating System: Microsoft Windows 10 Professionnel Éducation Version 10.0 (Build 19043)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.10 (R2021a)
Simulink Version 10.3 (R2021a)
5G Toolbox Version 2.2 (R2021a)
Audio Toolbox Version 3.0 (R2021a)
Bioinformatics Toolbox Version 4.15.1 (R2021a)
Communications Toolbox Version 7.5 (R2021a)
Computer Vision Toolbox Version 10.0 (R2021a)
Control System Toolbox Version 10.10 (R2021a)
Curve Fitting Toolbox Version 3.5.13 (R2021a)
DSP System Toolbox Version 9.12 (R2021a)
Data Acquisition Toolbox Version 4.3 (R2021a)
Database Toolbox Version 10.1 (R2021a)
Datafeed Toolbox Version 6.0 (R2021a)
Deep Learning HDL Toolbox Version 1.1 (R2021a)
Deep Learning Toolbox Version 14.2 (R2021a)
GPU Coder Version 2.1 (R2021a)
Image Acquisition Toolbox Version 6.4 (R2021a)
Image Processing Toolbox Version 11.3 (R2021a)
Instrument Control Toolbox Version 4.4 (R2021a)
MATLAB Coder Version 5.2 (R2021a)
MATLAB Compiler Version 8.2 (R2021a)
MATLAB Compiler SDK Version 6.10 (R2021a)
MATLAB Parallel Server Version 7.4 (R2021a)
MATLAB Report Generator Version 5.10 (R2021a)
Mapping Toolbox Version 5.1 (R2021a)
Optimization Toolbox Version 9.1 (R2021a)
Parallel Computing Toolbox Version 7.4 (R2021a)
Partial Differential Equation Toolbox Version 3.6 (R2021a)
Signal Processing Toolbox Version 8.6 (R2021a)
SimBiology Version 6.1 (R2021a)
SimEvents Version 5.10 (R2021a)
Simscape Version 5.1 (R2021a)
Simscape Driveline Version 3.3 (R2021a)
Simscape Electrical Version 7.5 (R2021a)
Simscape Fluids Version 3.2 (R2021a)
Simscape Multibody Version 7.3 (R2021a)
Simulink 3D Animation Version 9.2 (R2021a)
Simulink Check Version 5.1 (R2021a)
Simulink Code Inspector Version 3.8 (R2021a)
Simulink Coder Version 9.5 (R2021a)
Simulink Compiler Version 1.2 (R2021a)
Simulink Control Design Version 5.7 (R2021a)
Simulink Coverage Version 5.2 (R2021a)
Statistics and Machine Learning Toolbox Version 12.1 (R2021a)
Symbolic Math Toolbox Version 8.7 (R2021a)
System Identification Toolbox Version 9.14 (R2021a)
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

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by