neural network "train" throwing indexing error using example data

21 views (last 30 days)
I've started having trouble with a neural network fitting code segment that used to work just fine.
The code gives me a large number of nested errors:
Index in position 1 exceeds array bounds (must not exceed 1).
Error in initnw>initialize_layer (line 176)
range(inputStart(j):inputStop(j),:) =
temp2((inputStart(j):inputStop(j))-inputStart(j)+1,:);
Error in initnw (line 101)
out1 = initialize_layer(in1,in2);
Error in initlay>initialize_network (line 155)
net = feval(initFcn,net,i);
Error in initlay (line 97)
out1 = initialize_network(in1);
Error in network/init (line 32)
net = feval(initFcn,net);
Error in network/configure (line 253)
net = init(net);
Error in nntraining.config (line 146)
net = configure(network(net),X,T);
Error in nntraining.setup>setupPerWorker (line 102)
[net,X,Xi,Ai,T,EW,Q,TS,err] = nntraining.config(net,X,Xi,Ai,T,EW,configNetEnable);
Error in nntraining.setup (line 77)
[net,data,tr,err] = setupPerWorker(net,trainFcn,X,Xi,Ai,T,EW,enableConfigure);
Error in network/train (line 335)
[net,data,tr,err] =
nntraining.setup(net,net.trainFcn,X,Xi,Ai,T,EW,enableConfigure,isComposite);
Error in TRACE_NN_Fit (line 122)
[Nets.(strcat('Eqn',num2str(Equation))).Atl.(Name),tr] =
train(net,P(InAtlInds,:)',Data(InAtlInds,:)');
There's a lot involved up to that point, so rather than give my specific application, I'll note that I get the same error using the Neural Net Fitting Wizard (nftool) with the built-in example data provided in the tool under the name "body fat" or "abalone rings" (the problem seems to happen whenever the input is more than 1 dimension... here's the GUI image):
Any suggestions?
Thanks in advance... had this problem for a year or two now across multiple computers.

Accepted Answer

Brendan Carter
Brendan Carter on 20 Oct 2022
Edited: Brendan Carter on 20 Oct 2022
A colleague just pointed out that there is a function name conflict with a sub function several layers down from the cpt_cmap submission. Moving cpt_cmap off the path seemed to resolve the issue.
  1 Comment
Saikat Sengupta
Saikat Sengupta on 28 Aug 2023
Edited: Saikat Sengupta on 28 Aug 2023
Hi Brendan,
Thank you for updating your post with an answer. Could you please elaborate a bit on how you solved it ? I am having the same issue, but I cant find cpt_cmap in my installation (which cpt_cmap does not find anything). I dont recall installing a cptcmap package.
thanks in advance,
Saikat Sengupta

Sign in to comment.

More Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!