MATLAB Answers

Out of Memory on classify(.​..,'Execut​ionEnviron​ment','cpu​') on SUSE Linux

27 views (last 30 days)
I've got an issue with the classify function running on SUSE Linux. I've got a network which is trained for image analysis. When I try to classify new images (100-500) with the network, it takes a while until Matlab takes all the system memory (48gb) and eventually gets killed by the OS (i.e. the Matlab process just shuts down).
x=classify(net,beadImgs,'ExecutionEnvironment','cpu');
The same program works fine on a Windows machine with 16gb of RAM either with 'gpu' or with 'cpu' Execution environment (I cant test the 'gpu' Option on the Linux system). My guess is that this memory footprint is 'somewhat unintended'. Does anybody have an idea on how to fix this?
EDIT:
Okay I figured out a workaround. Manually setting the batch size fixes the issue for the moment. Nevertheless the different memory footprint on different operating systems is still mysterious.
ver yields:
--------------------------------------------------------------------------------------------------------
MATLAB Version: 9.7.0.1247435 (R2019b) Update 2
MATLAB License Number: #######
Operating System: Linux 4.12.14-lp151.28.32-default #1 SMP Wed Nov 13 07:50:15 UTC 2019 (6e1aaad) x86_64
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
--------------------------------------------------------------------------------------------------------
MATLAB Version 9.7 (R2019b)
Simulink Version 10.0 (R2019b)
Bioinformatics Toolbox Version 4.13 (R2019b)
Communications Toolbox Version 7.2 (R2019b)
Computer Vision Toolbox Version 9.1 (R2019b)
Control System Toolbox Version 10.7 (R2019b)
Curve Fitting Toolbox Version 3.5.10 (R2019b)
DSP System Toolbox Version 9.9 (R2019b)
Database Toolbox Version 9.2 (R2019b)
Deep Learning Toolbox Version 13.0 (R2019b)
Econometrics Toolbox Version 5.3 (R2019b)
Embedded Coder Version 7.3 (R2019b)
Fixed-Point Designer Version 6.4 (R2019b)
Fuzzy Logic Toolbox Version 2.6 (R2019b)
Global Optimization Toolbox Version 4.2 (R2019b)
Image Acquisition Toolbox Version 6.1 (R2019b)
Image Processing Toolbox Version 11.0 (R2019b)
Instrument Control Toolbox Version 4.1 (R2019b)
MATLAB Coder Version 4.3 (R2019b)
MATLAB Compiler Version 7.1 (R2019b)
Mapping Toolbox Version 4.9 (R2019b)
Model Predictive Control Toolbox Version 6.3.1 (R2019b)
Optimization Toolbox Version 8.4 (R2019b)
Parallel Computing Toolbox Version 7.1 (R2019b)
Partial Differential Equation Toolbox Version 3.3 (R2019b)
Signal Processing Toolbox Version 8.3 (R2019b)
Simscape Version 4.7 (R2019b)
Simscape Electrical Version 7.2 (R2019b)
Simscape Multibody Version 7.0 (R2019b)
Simulink 3D Animation Version 8.3 (R2019b)
Simulink Coder Version 9.2 (R2019b)
Simulink Control Design Version 5.4 (R2019b)
Simulink Design Optimization Version 3.7 (R2019b)
Stateflow Version 10.1 (R2019b)
Statistics and Machine Learning Toolbox Version 11.6 (R2019b)
Symbolic Math Toolbox Version 8.4 (R2019b)
System Identification Toolbox Version 9.11 (R2019b)
Vehicle Network Toolbox Version 4.3 (R2019b)
Wavelet Toolbox Version 5.3 (R2019b)

  2 Comments

Joss Knight
Joss Knight on 16 Dec 2019
What happens when you use 'Acceleration', 'none' in your call to classify. Does that make it work?
Wolfgang Gross
Wolfgang Gross on 7 Jan 2020
I'm sorry for the late answer. I finally found the time to test your suggestion now. Indeed that makes it work as well.
Kind regards

Sign in to comment.

Accepted Answer

Kaashyap Pappu
Kaashyap Pappu on 24 Dec 2019
This response is just for future reference:
Modifying the Name-Value pair, ‘MiniBatchSize’, to a lower value can help with this issue. The default value is 128. If a similar issue is present during training, you can similarly set the same property in trainNetwork and imageDatastore to a lower value to help with this issue.

  0 Comments

Sign in to comment.

More Answers (0)


Translated by