MiniBatch Error for GAN training
조회 수: 19 (최근 30일)
이전 댓글 표시
When I was following the provided code GAN MATLAB, and I was executed the code in MATLABR2023a. I found that the below code is having the mini batch error. I have installed the Deep Learning Toolbox in my MATLAB. Please help me to solve it. Thanks in advance!
augimds.MiniBatchSize = miniBatchSize;
mbq = minibatchqueue(augimds, ...
MiniBatchSize=miniBatchSize, ...
PartialMiniBatch="discard", ...
MiniBatchFcn=@preprocessMiniBatch, ...
MiniBatchFormat="SSCB");
Error using minibatchqueue>iValidateMiniBatchFcn
Invalid value for 'MiniBatchFcn'. Unable to find function 'preprocessMiniBatch'.
Error in minibatchqueue>iParseInputs (line 695)
iValidateMiniBatchFcn(options.MiniBatchFcn, numVariables, options.NumOutputs);
Error in minibatchqueue (line 291)
options = iParseInputs(numVariables, varargin{:});
Error in gangan (line 83)
mbq = minibatchqueue(augimds, ...
댓글 수: 0
답변 (1개)
Sugandhi
2023년 5월 14일
Hi Candy Lau,
The error message indicates that MATLAB cannot find the `preprocessMiniBatch` function, which is used as input to the `MiniBatchFcn` argument of the `minibatchqueue` function. This error can occur if the function is not defined in the current workspace or on the MATLAB path.
To resolve this error, one of the possible workaround can be to define the `preprocessMiniBatch` function in a separate file or script in the same folder or on the MATLAB path.
Once you have defined the `preprocessMiniBatch` function, save it to a separate file or script, and make sure that the file is on the MATLAB path. Then, modify the `mbq` initialization code in your script to the following:
mbq = minibatchqueue(augimds, ...
'MiniBatchSize', miniBatchSize, ...
'PartialMiniBatch', 'discard', ...
'MiniBatchFcn', @preprocessMiniBatch, ...
'MiniBatchFormat', 'SSCB');
This should properly initialize the `mbq` object with your custom `preprocessMiniBatch` function and resolve the error you are seeing.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!