nntool problem

조회 수: 15 (최근 30일)
Mostafa Mohammed
Mostafa Mohammed 2011년 4월 17일
답변: TED MOSBY 2025년 6월 8일
I was trying to train the nntool with a feature vector of the no.of black pixels in a box in an image divided into 5*5 boxes where there is 5000 images for the digits from 0 to 9 .
so the input matrix for training is 25*50000
the target matrix dimensions is (as I think )10*50000
with a pattern of the following form:
target=zeros(25,50000);
target(1,1:5000)=ones(1,5000);%this correspond to zero
target(2,5001:10000)=ones(1,5000);%this corresponds to one
and so on
so my questions are:
are the dimensions of the target matrix correct?
and if so (if correct) i got an error message:
??? Insufficient number of outputs from right hand side of equal sign to satisfy assignment.
Error in ==> nntool at 681
[errmsg,errid] = me.message;
which I know from previous question on this forum that it is an out of memory error.
I'm having Matlab r2009 a,4GB RAM and 2.00 GHZ Intel core 2Duo .
so please what should i do?

답변 (1개)

TED MOSBY
TED MOSBY 2025년 6월 8일
Hi,
Your target matrix dimensions should be 10 × 50000, not 25 × 50000. Your data must be arranged as:
  • Inputs: an I × N matrix, where I is the number of features (25 here) and N is the number of samples (50000).
  • Targets: an O × N matrix, where O is the number of output neurons (one per class—in your case 10 digits) and N is the number of samples.
T = zeros(10,50000); % 10 classes × 50000 samples
That error message inside nntool is actually masking an out-of-memory failure that happens earlier in the call to TRAIN.
Refer here for more details on the error: https://www.pianshen.com/ask/32443162216/
Workarounds:
  1. The simplest workaround is to upgrade MATLAB, then it can show you the real error and you can tune the memory usage accordingly.
  2. For your current version you can try training on a smaller or balanced subset, or stream your data in batches so you don’t build enormous temporary matrices.
Hope this helps!

카테고리

Help CenterFile 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