3
我是Python的新手,我想導入一個大小爲850M的matlab結構體。我使用「loadmat」,但我得到一個內存錯誤:loadmat python內存錯誤
return self._matrix_reader.array_from_header(header, process) File "mio5_utils.pyx", line 624, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy\io\matlab\mio5_utils.c:5401) File "mio5_utils.pyx", line 653, in scipy.io.matlab.mio5_utils.VarReader5.array_from_header (scipy\io\matlab\mio5_utils.c:4849) File "mio5_utils.pyx", line 706, in scipy.io.matlab.mio5_utils.VarReader5.read_real_complex (scipy\io\matlab\mio5_utils.c:5578) File "mio5_utils.pyx", line 424, in scipy.io.matlab.mio5_utils.VarReader5.read_numeric (scipy\io\matlab\mio5_utils.c:3439) File "mio5_utils.pyx", line 360, in scipy.io.matlab.mio5_utils.VarReader5.read_element (scipy\io\matlab\mio5_utils.c:3164) File "streams.pyx", line 76, in scipy.io.matlab.streams.GenericStream.read_string (scipy\io\matlab\streams.c:1408) MemoryError
我在Windows XP上運行python 3.2與3.5G的RAM。這裏是我的代碼:
from scipy.io import matlab as mio
mat = mio.loadmat(DIR + '/input.mat')
你能幫我,告訴我該怎麼做才能解決這個問題嗎?