-
-
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
Distributed LDA "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()" #911
Comments
@tmylk I am ready to take this up. How shall I proceed to solve this stuff? |
There's a potential fix in the text above. Investigating if it actually works would be very useful |
@tmylk I am unable to replicate the error
|
@harshul1610 first start the Pyro name server via |
@tmylk @markroxor I am running on pyro4(4.47) but getting following:
Any suggestions? |
@tmylk please give proper solution you told "There's a potential fix in the text above. Investigating if it actually works would be very useful" please i m stuck up with this from 2 days too much find but nothing find please help me out |
@hiral2cool Would be grateful for your feedback on this potential fix suggested on the mailing list (also in the main description of this issue):
|
@tmylk @markroxor I have tried to reproduce the issue and I used the following steps:
The potential fix in the mailing list suggested that **models_params in lda_dispatcher.py be set to true. Since _models_params refers to a potential list of arguments, I am assuming this means _distributed==True Would I be correct in assuming that the author of the mailing list post suggested this as a fix in the initialize function in lda_dispatcher.py:
This did not seem to have an effect on the error. I am wondering if I am misinterpreting the bug fix suggested by the author. |
The mailing list fix is that if Anyway, it would be good to get rid of the error message, maybe with some other fix. |
@tmylk Isn't it enough to replace I remember there were some changes around the I don't see how it's related to the |
@piskvorky - agreed, this is unrelated to distributed. I just came across the same error trying to infer topic distributions using the LdaMulticore class which suffers from the same bug. The problem is in ldamodel.py. By replacing
I'm not terribly familiar with how numpy handles list comprehensions over nparray's, I'll have to look into it a bit more. edit: my mistake, just realized the model is expect a list of 2-tuples, not the nparray I was trying to pass. Makes sense. |
Hi tmylk - My input is in a COO/triplet sparse matrix format. I load it in using numpy:
If memory serves, I made the mistake of passing my sparse matrix (sm) to LdaMulticore inference method instead of the gensim corpus (corp). By passing in the numpy sparse matrix, I arrived at the error above. |
Raised on the mailing list
A potential fix suggested on the mailing list:
The text was updated successfully, but these errors were encountered: