-
-
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
DeprecationWarning: numpy sum :: np.sum(generator) is deprecated - LDA #2270
Comments
I am facing the similar problem for LDA using gensim, Hope to receive some help for this. Code: Warning C:\Users\shrav\Anaconda3\lib\site-packages\gensim\models\ldamodel.py:826: DeprecationWarning: Calling np.sum(generator) is deprecated, and in the future will give a different result. Use np.sum(np.from_iter(generator)) or the python sum builtin instead. File "", line 9, in File "C:\Users\shrav\Anaconda3\lib\site-packages\gensim\models\ldamodel.py", line 371, in init File "C:\Users\shrav\Anaconda3\lib\site-packages\gensim\models\ldamodel.py", line 734, in update File "C:\Users\shrav\Anaconda3\lib\site-packages\gensim\models\ldamodel.py", line 781, in do_mstep File "C:\Users\shrav\Anaconda3\lib\site-packages\gensim\models\basemodel.py", line 36, in print_topics File "C:\Users\shrav\Anaconda3\lib\site-packages\gensim\models\ldamodel.py", line 883, in show_topics File "C:\Users\shrav\Anaconda3\lib\site-packages\numpy\core_methods.py", line 36, in _sum TypeError: reduce() takes at most 5 arguments (6 given) |
Is there any solution available? I recently installed the all the packages. Also the result varies with every run. The coherence value of topic gets changed with every run. |
This can happen if you don't pin seed, i.e. expected situation. |
I would like to contribute 😃 . |
@rsdel2007 you are welcome :) |
I am still getting this issue |
@shishir13 this issue is closed. If you want to report a similar issue, please open a new ticket, with full information (follow the issue template). |
Warning:
score += np.sum(cnt * logsumexp(Elogthetad + Elogbeta[:, int(id)]) for id, cnt in doc)
/usr/local/lib/python2.7/dist-packages/gensim/models/ldamodel.py:1077: DeprecationWarning: Calling np.sum(generator) is deprecated, and in the future will give a different result. Use np.sum(np.from_iter(generator)) or the python sum builtin instead.
score += np.sum(cnt * logsumexp(Elogthetad + Elogbeta[:, int(id)]) for id, cnt in doc)
Versions
import platform; print(platform.platform())
Linux-4.16.0-x86_64-with-Ubuntu-18.04-bionic
import sys; print("Python", sys.version)
('Python', '2.7.15rc1 (default, Nov 12 2018, 14:31:15) \n[GCC 7.3.0]')
import numpy; print("NumPy", numpy.version)
('NumPy', '1.15.4')
import scipy; print("SciPy", scipy.version)
('SciPy', '1.1.0')
import gensim; print("gensim", gensim.version)
('gensim', '3.6.0')
from gensim.models import word2vec;print("FAST_VERSION", word2vec.FAST_VERSION)
('FAST_VERSION', 1)
The text was updated successfully, but these errors were encountered: