out of memory error for large data
이전 댓글 표시
I am working with a 50000*2048 matrix, but I want to do the simulation only once and save the data in a h5 file, unfortunately I am having memory problems and I can't save or load the data from the h5 file. Is there any solution to store large data ?
댓글 수: 9
Chad Greene
2021년 4월 19일
Is it possible to do your processing in tiles, or do you need to operate on the entire matrix at once? For example, you could break it up into 50 1000*2048 matrices and load only the sections you need by specifiying the start and stride in h5read.
Georges Murr
2021년 4월 19일
Walter Roberson
2021년 4월 19일
That array is not even 1 gigabyte? It is not clear where the memory problem is coming from?
Georges Murr
2021년 4월 19일
Clayton Gotberg
2021년 4월 19일
It doesn't seem like you'd need the entire matrix for abs()^2. The only way those operations make sense are if they're performed elementwise (since, your matrix isn't square, the ^2 operation isn't well-defined as matrix multiplication). However, you might see if tall arrays solve your memory trouble satisfactorily - you'll just need to make sure all of the functions you use in MATLAB as compatible.
50 * 1000 * 2048 * 8
ans / 10^9
Not even 1 gigabyte. Not unless your matrices are complex-valued or are not numeric.
Georges Murr
2021년 4월 19일
Walter Roberson
2021년 4월 19일
Okay, so double the storage for complex, still gets you 1.7 gigabytes at most. That would not be a problem unless you have quite a small memory (such as 4 gigabytes)
Georges Murr
2021년 4월 19일
답변 (1개)
per isakson
2021년 5월 7일
0 개 추천
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!