Fitnet: Out of memory error solved by transposing?

7 views (last 30 days)
Pelajar UM
Pelajar UM on 18 Oct 2021
Commented: Pelajar UM on 19 Oct 2021
Here's the code:
net_set = fitnet (4, 'trainlm');
my_ANN = train (net_set, input,output)
Input and output both are 49736x3 arrays.
Here's the exact error:
Error using backpropJacobianStatic
Requested 447628x447628 (1492.9GB) array exceeds maximum array size preference (31.9GB). This might cause MATLAB to become
When I transpose the arrays, it runs with no problems:
my_ANN = train (net_set, input.',output.')

Accepted Answer

Chunru on 19 Oct 2021
Edited: Chunru on 19 Oct 2021
When you use "my_ANN = train (net_set, input,output)", your network will have a input/output size of 49736, which results in many weights in your network. If you use "my_ANN = train (net_set, input.',output.')", the network input/output size is only 3 and the weights in different layers are small so you can train the networkd with no problem.
net_set = fitnet (4, 'trainlm');
input = randn(49736, 3);
output = randn(49736, 3);
my_ANN = train (net_set, input',output');
% To see the trained network architecture
% view(my_ANN)
Pelajar UM
Pelajar UM on 19 Oct 2021
Thanks. I think I didn't make myself clear enough.
The idea is to use more data for training so that the network can get familiar with and handle more possible combinations of x,y,z. So that's why I want to do the training with 10x3 input/output.
Are you saying that this network once fully trained (so it is pre-trained at this point, no more training) cannot be used to predict 1x3 output based on 1x3 input (basically one coordinates at a time)?
In otherwords, the number of input/output during prediction have to match what was exactly used to train the network?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!