-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OverflowError: Python int too large to convert to C long #321
Comments
Yes, it is wrapped in Or is the issue something else? I'm not sure I understood your report. |
Oh, I use the master branch. At line 521 in reset_weights def reset_weights(self):
# ...
random.seed(uint32(self.hashfxn(self.index2word[i] + str(self.seed)))) hash (built-in function) in 64 bit Python return an 64 bit integer, and rasie OverflowError: Python int too large to convert to C long |
[In doc2vec] |
@luopuya is this relevant? Do you still get the "OverflowError: Python int too large to convert to C long" in |
I fix it by setting my hashfxn in construct function def myhashfxn(obj): Word2Vec(hashfxn=myhashfxn) |
I'm looking at related 32-/64-bit issues, and would like to understand what's happening here... but I can only trigger a ValueError (not an OverflowError) when passing large values into Is there a chance that you were getting the error from some older code (that doesn't match the "line 521" excerpt you quoted)? Or maybe you're using some older Numpy version of If your hashfxn-workaround still seems necessary, it'd be good to know the versions of Python, gensim, and Numpy in play. |
Sorry for late reply. It is old version |
I am getting this error as well on: |
see also discussion here: https://www.kaggle.com/c/word2vec-nlp-tutorial/forums/t/11197/gensim-word2vec-cython-on-windows/59956 |
@eyaler I confirm the same error: |
@GraphGrail – are you sure it's gensim 0.12.1 that's being run when you get the error, and not some older version? (Can you share the exact error message, with reported line numbers?) (If this is happening, then maybe the Windows Python + numpy that people are using, that claims to be 64-bit, may not really be 64-bit? Another user having a similar problem suggested there is no true numpy support for 64-bit Windows... and even though I'd usually suggest 64-bit Python, they reported fewer problems, on Windows, after they switched to 32 bit.) |
@GraphGrail Could you create a PR with a test that triggers this error? We now have continuous Win 32 and 64 builds. |
@maribethrc What OS, and is there a chance you're running a 32-bit Python, or an inadvertently mixed set of 32/64-bit versions of Python and 3rd-party libraries? (How did you install Python, and how did you install required libraries like Numpy?) |
map return an iterator instead of a list in Python 3
seems to wrap in list call: list(map(REAL, parts[1:]))
The text was updated successfully, but these errors were encountered: