Memory error when running %time U, s, Vh = linalg.svd(vectors, full_matrices=False)

Hi,
Im getting memory error when running the python code below on “2. Topic Modeling with NMF and SVD.ipynb”. How do i get around this error?

%time U, s, Vh = linalg.svd(vectors, full_matrices=False)


MemoryError Traceback (most recent call last)
in

C:\Program Files (x86)\Python37-32\lib\site-packages\scipy\linalg\decomp_svd.py in svd(a, full_matrices, compute_uv, overwrite_a, check_finite, lapack_driver)
127 # perform decomposition
128 u, s, v, info = gesXd(a1, compute_uv=compute_uv, lwork=lwork,
→ 129 full_matrices=full_matrices, overwrite_a=overwrite_a)
130
131 if info > 0:

MemoryError:

i found a google collab edition on the internet and it ran without error. I would like to know why i get the error on my PC.

You can check for memory utilization on the colab side (put this in a cell and execute: !free )and compare that with memory utilization on your windows box. Maybe you just don’t have enough memory on your local machine?

EDIT: I just ran it on my MBP and the max ram it hit was about 1.5 GB. So, my guess is that if you don’t have 1.5GB free when you run that cell, you’ll probably see that error.