out of memory error
3 ビュー (過去 30 日間)
古いコメントを表示
hi
i have this code, and the loading file is a huge cell arre with matrix in each cell. so when i run this code i get out of memory error. my memory storage is 6 GB, and i test it on 8GB memory storage but again i got the same error. So is there any solution for my code to work faster and lighter?!!!
clc,close all, clear all
load EE_Scenario1_82_31_3000_3000_800_3E-4_-90.mat % this is 600.0 MB.
for i0 = 1:size(EE_TOT)
i = 1;
j = 1;
for j0 = 1:size(EE_TOT)
if (~isempty(EE_TOT{i,j})) & (INDEX{i,j}(i,:) > 0)
MeanEE(i0,j0) = mean(mean((EE_TOT{i,j}(INDEX{i,j}(:)))));
else
continue
end
j = j+1;
end
end
M_TOT = mean(mean(MeanEE));
1 件のコメント
Jakob Wagner
2020 年 11 月 18 日
編集済み: Jakob Wagner
2020 年 11 月 18 日
I had a similar issue half a year ago, but using tall arrays and parallel computing ("parfor" using both of my cores for computing), your RAM has to do less work at once while your calulation time gets lowered significantly.
best regards
% get your path
[openfile openpath]=uigetfile('*.lvm')
% decrease your RAM torture
ds=tabularTextDatastore([openpath openfile],...
'FileExtensions','.lvm',...
'Delimiter','\t',...
'NumHeaderLines',23,...
'ReadVariableNames',0);
% make it a tall array (Your program only loads a subset of your Datastorage at once)
Arr=tall(ds);
% do here, whatever needs to be done with the whole dataset
Arr=gather(Arr);
%do here, what needs to be done to analyze and refine
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Text Data Preparation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!