Home > Back-end >  to run matlab narxnet training with linux HPC cpu
to run matlab narxnet training with linux HPC cpu

Time:11-13

I am using the narxnet to do training in linux based HPC cpus. As I already did run the same code in windows desktop. To get more hidden layers I am trying to run in HPC .

I see the following error: In .e file

{Error using appwindowfactory
This functionality is not supported under the -nojvm startup option.

Error in matlab.ui.internal.uifigureImpl (line 80)
window = appwindowfactory('WindowStyle','normal',...

Error in uifigure (line 26)
window = matlab.ui.internal.uifigureImpl(varargin{:});

Error in nnet.guis.StandaloneTrainToolView (line 115)
            this.Figure = uifigure('Visible', 'off',...

Error in nnet.guis.NNTrainToolFactory/createStandaloneView (line 12)
            view = nnet.guis.StandaloneTrainToolView(this);

Error in nnet.guis.StandaloneTrainToolPresenter (line 32)
            this.StandaloneTrainToolView = this.TrainToolFactory.createStandaloneView();

Error in nnet.guis.NNTrainToolFactory/createStandalonePresenter (line 8)
            presenter = nnet.guis.StandaloneTrainToolPresenter(this);

Error in nnet.train.TrainToolFeedback/startImpl (line 70)
                    this.TrainToolPresenter = this.TrainToolFactory.createStandalonePresenter();

Error in nnet.train.FeedbackHandler/start (line 18)
        this.startImpl(useSPMD,data,net,tr,options,status);

Error in nnet.train.MultiFeedback/startImpl (line 29)
        this.Handlers{i}.start(useSPMD,data,net,tr,options,status);

Error in nnet.train.FeedbackHandler/start (line 18)
        this.startImpl(useSPMD,data,net,tr,options,status);

Error in nnet.train.trainNetwork>trainNetworkInMainThread (line 42)
feedback.start(false,rawData,archNet,worker.tr,calcLib.options,worker.status);

Error in nnet.train.trainNetwork (line 27)
    [archNet,tr] = trainNetworkInMainThread(archNet,rawData,calcLib,calcNet,tr,feedback,localFcns);

Error in trainscg>train_network (line 145)
[archNet,tr] = nnet.train.trainNetwork(archNet,rawData,calcLib,calcNet,tr,localfunctions);

Error in trainscg (line 55)
            [out1,out2] = train_network(varargin{2:end});

Error in network/train (line 380)
    [net,tr] = feval(trainFcn,'apply',net,data,calcLib,calcNet,tr);
} 

The code lines which have issue

% Create a NARX network. Define the input delays, feedback delays, and size of the hidden layers.
net = narxnet(1:4,1:4,4);
% Prepare the time series data using preparets. This function automatically shifts input and target time series by the number of steps needed to fill the initial input and layer delay states.
[Xs,Xi,Ai,Ts] = preparets(net,Xcell,{},Ycell);
% Train the NARX network. The train function trains the network in an open loop (series-parallel architecture), % including the validation and testing steps.
net.trainFcn = 'trainscg'  % to avoid the memory issue BackpropJacobi
net = train(net,Xs,Ts,Xi,Ai);
% view(net)

% Calculate the network output Y, final input states Xf, and final layer states Af of the open-loop network from the network input Xs, initial input states Xi, and initial layer states Ai.
[Y,Xf,Af] = net(Xs,Xi,Ai);

I did comment the view to avoid any ui layout

CodePudding user response:

After obtain a net object by

net = narxnet(1:4,1:4,4);

Could you check this property on the net object,

net.trainParam.showWindow

If this is true, a training window nntraintool should be displayed, which could cause the problem.

Also if your actual code is more complicated, matlab may reset this option in some of the steps, so you need to change the option at the right position.

CodePudding user response:

I have another question about running narx with bigg data. I tried increase the hidden size, to get better model.

seems like 900 is some upper limit for the hidden units allowed- memory error. with the narxnet of :

net = narxnet(1:25,1:25,1000);

I get this error .e file

{Error using zeros
Requested 1000x54373200 (405.1GB) array exceeds maximum array size preference
(377.4GB). This might cause MATLAB to become unresponsive.

Error in nnet.internal.configure.inputWeight (line 25)
  net.IW{i,j} = zeros(newSize);

Error in nnet.internal.configure.input (line 42)
  net = nnet.internal.configure.inputWeight(net,j,i,x);

Error in network/configure (line 244)
  net = nnet.internal.configure.input(net,i,X{i});

Error in preparets (line 302)
    net = configure(net,'input',xx(i,:),i);
}

with the size :

net = narxnet(1:25,1:25,600);

we get the following

{Out of memory.

Error in normr (line 27)
    xi(~isfinite(xi)) = 0;

Error in randnr>new_value_from_rows_cols (line 152)
  x = normr(rands(rows,cols));

Error in randnr (line 98)
          out1 = new_value_from_rows_cols(in1,in2);

Error in initnw>calcnw (line 287)
wDir = randnr(s,r);

Error in initnw>initialize_layer (line 212)
  [w,b] = calcnw(range,net.layers{i}.size,active);

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 31)
  net = feval(initFcn,net);

Error in network/configure (line 253)
net = init(net);

Error in preparets (line 302)
    net = configure(net,'input',xx(i,:),i);
}
  • Related