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 件のコメント

Joss Knight
Joss Knight 2022 年 4 月 2 日
Can you provide the error message? You've only provided the call stack.
Abu Yusuf
Abu Yusuf 2022 年 4 月 3 日
Thanks for your answer,
I get this warning message
thanks for your answer, I get this warning message
Joss Knight
Joss Knight 2022 年 4 月 3 日
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.
Abu Yusuf
Abu Yusuf 2022 年 4 月 4 日
I do not get any warning message about this error
Joss Knight
Joss Knight 2022 年 4 月 16 日
There is more red text above this, you need show us all the red text.
Abu Yusuf
Abu Yusuf 2022 年 4 月 16 日
No , there is not
Joss Knight
Joss Knight 2022 年 4 月 17 日
編集済み: Joss Knight 2022 年 4 月 17 日
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.
Abu Yusuf
Abu Yusuf 2022 年 4 月 18 日
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 2022 年 4 月 18 日
Great! So there's your answer. When you modified this example you presumably forgot to copy over the accompanying file augmentDataForLD2HDCT.m.

サインインしてコメントする。

 採用された回答

Joss Knight
Joss Knight 2022 年 4 月 18 日

0 投票

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

9 件のコメント

Abu Yusuf
Abu Yusuf 2022 年 4 月 19 日
I can't find this file
Joss Knight
Joss Knight 2022 年 4 月 19 日
"the accompanying file augmentDataForLD2HDCT.m that comes with this example"
Abu Yusuf
Abu Yusuf 2022 年 4 月 19 日
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.
Abu Yusuf
Abu Yusuf 2022 年 4 月 21 日
Thanks for your help and patience.
This problem appeared
Joss Knight
Joss Knight 2022 年 4 月 21 日
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?
Abu Yusuf
Abu Yusuf 2022 年 4 月 21 日
-----------------------------------------------------------------------------------------------------
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)
Joss Knight
Joss Knight 2022 年 4 月 21 日
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
Abu Yusuf
Abu Yusuf 2022 年 4 月 21 日
I appreciate your help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeIntroduction to Installation and Licensing についてさらに検索

質問済み:

2022 年 3 月 31 日

コメント済み:

2022 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by