Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6979357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:52:35+00:00 2026-05-27T17:52:35+00:00

I tried to use LSI to generate vectors to represent documents. I am using

  • 0

I tried to use LSI to generate vectors to represent documents. I am using the svd package in Scipy library. But the program throws a memory error. The size of my matrix is 100*13057. Is this too big for my 8G RAM?

I searched this problem in stackflow. Somebody said I just have to install 64-bit Python on my 64-bit OS. (Now, I have 32-bit Python on 64-bit OS). But re-installing all libraries is too trivial. Another opinion is to convert sparse matrix.

So does everyone have idea on this problem? Thanks!

raw_matrix = []
for text in forest_lsi:
    raw_matrix.append( text.get_vector() )
from svd import compute_svd
print("The size of raw matrix: "+str(len(raw_matrix))+" * "+str(len(raw_matrix[0])))
matrix = compute_svd( raw_matrix )

The message in Concole is as bellow:

The size of raw matrix: 100 * 13057
Original matrix:
[[1 1 2 ..., 0 0 0]
 [0 3 0 ..., 0 0 0]
 [0 0 0 ..., 0 0 0]
 ..., 
 [0 0 0 ..., 0 0 0]
 [0 0 1 ..., 0 0 0]
 [0 0 2 ..., 1 1 3]]
Traceback (most recent call last):
  File "D:\workspace\PyQuEST\src\Practice\baseline_lsi.py", line 93, in <module>
    matrix = compute_svd( raw_matrix )
  File "D:\workspace\PyQuEST\src\Practice\svd.py", line 12, in compute_svd
    U, s, V = linalg.svd( matrix )
  File "D:\Program\Python26\lib\site-packages\scipy\linalg\decomp_svd.py", line 79, in svd
    full_matrices=full_matrices, overwrite_a = overwrite_a)
MemoryError
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:52:36+00:00Added an answer on May 27, 2026 at 5:52 pm

    Your V matrix will take 13057*13057*8 bytes of memory if you’re using the default dtype=np.float, which is approx. 1.4GB. My hunch is that that’s too large for your 32-bit Python. Try using 32-bit floating point numbers, that is dtype=np.float32, to cut memory use in half, or start using scipy.sparse (almost always a good idea for information retrieval problems).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to use boost library in 64 bit mode of VS2008 but I'm
I tried to use DriveInfo.IsReady, but it returns false if an unformatted floppy is
I tried to use this on my class library mylib.core.data.dll and got a successful
I tried to use OPTION (MAXRECURSION 0) in a view to generate a list
I tried to use an image file in my HTML template. But when I
I tried to use object expression to extend the IDelegateEvent, but in fsi there
I have tried: use information_schema update referential_constraints set delete_rule='cascade'; but got the following error:
I tried use file_put_contents output new page. but I meet some trouble in breaking
I tried to use TestNG with Apache Ivy , but was unsuccessful. Here is
I tried to use setcookie(user, , time()-3600) to delete a cookie from php, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.