MATLAB: Do I receive an “Insufficient number of outputs” error when training a network created using NNTOOL from the Neural Network Toolbox 6.0.3 (R2009b)

errorhugeinsufficientlargemanymemorynntoolnumberoutputs

I define the following dummy input and target data:
p=rand(1000,51); % 1000 inputs, 51 set
t=sin(0:0.02:1); 1 output, 51 sets
I then create a network using NNTOOL and train the network (using default settings). As soon as the training begins, I receive the following error:
??? Insufficient number of outputs from right hand side of equal sign to satisfy assignment.
Error in ==> nntool at 681
[errmsg,errid] = me.message;
com.mathworks.jmi.MatlabException: Insufficient number of outputs from right hand side of equal sign to satisfy assignment.

Best Answer

This enhancement has been incorporated in Release 2010b (R2010b). For previous product releases, read below for possible workarounds:
The error message
Error in ==> nntool at 681
[errmsg,errid] = me.message;
is due to an out of memory error that occurs earlier during the call to TRAIN in a TRY CATCH block. The ability to show the standard out of memory error message is not available in NNTOOL in Neural Network Toolbox 6.0.3 (R2009b).
As a workaround, reduce the huge number of inputs, since they are generating huge internal temporary matrices when calculating the training steps.
To learn more about general strategies to avoid memory errors, you may refer to the following documentation pages: