dimensions problem with processImagesMNIST

3 views (last 30 days)
Hi,
Im trying to load MNIST dataset based on the instructions here:
But for some reason when i call :
XTrain = processImagesMNIST(filenameImagesTrain);
i get the following error:
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension.
Error in processImagesMNIST (line 31)
X = reshape(X,numCols,numRows,numImages);
Error in main (line 49)
XTrain = processImagesMNIST(filenameImagesTrain);
and when i call :
XTest = processImagesMNIST(filenameImagesTest);
i get the following error:
Error using reshape
Size vector elements should be nonnegative.
Error in processImagesMNIST (line 31)
X = reshape(X,numCols,numRows,numImages);
Does anyone know what im doing wrong?
Thanks
  1 Comment
Anshika Chaurasia
Anshika Chaurasia on 2 Nov 2021
Hi,
I ran the code in MATLAB R2021a and R2021b and didn't get any error.
Which MATLAB version you are using?
Can you share the script which is throwing the error? This will help to reproduce the error at our end.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!