我试图反转一个大的(150000,150000)
稀疏矩阵如下:
import scipy as sp import scipy.sparse.linalg as splu #Bs is a large sparse matrix with shape=(150000,150000) #calculating the sparse inverse iBs=splu.inv(Bs)
导致以下错误消息:
Traceback (most recent call last): iBs=splu.inv(Bs) File "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/dsolve/linsolve.py", line 134, in spsolve autoTranspose=True) File "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/dsolve/umfpack/umfpack.py", line 603, in linsolve self.numeric(mtx) File "/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/dsolve/umfpack/umfpack.py", line 450, in numeric umfStatus[status])) RuntimeError:failed with UMFPACK_ERROR_out_of_memory
我重新编写了程序来简单地求解线性微分方程组:
import numpy as np N=Bs.shape[0] I=np.ones(N) M=splu.spsolve(Bs,I)
我又遇到了同样的错误
我在具有16 GB RAM的计算机上使用此代码,然后将其移动到具有32 GB RAM的服务器上,仍然无济于事.
有没有人遇到过这个?