ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Running the code brings a Value error:
0.8 -mbsize 10 -dataset nips
{'infSeed': 1, 'alpha': 1.0, 'gamma': 2.0, 'Nmax': 40, 'kappa_sgd': 0.6, 'tau': 0.8, 'mbsize': 10.0, 'dataset': 'nips'}
Loading the glove dict file....
Main runner ...
num_docs: 1566
Traceback (most recent call last):
File "./runner.py", line 225, in
I tried different methods, including changing the boolean check in core_distributions.py, line 243:
if ((mu,kappa) == (None,None)) and any(x != None for x in (mu_0, C_0, m_0, sigma_0)): or if ((mu,kappa) == (None,None)) and not any(x == None for x in (mu_0, C_0, m_0, sigma_0)):
However it doesn't change anything and the error stays. Have you any solution?
I had the same problem and I solved it with downgrading numpy to version 1.11.3
My environment:
Ubuntu 18.04 LTS
python 3.6
I replaced
if (mu,kappa) == (None,None) and None not in (mu_0,C_0,m_0,sigma_0):
with
if (mu,kappa) == (None,None) and mu_0 is not None and C_0 is not None and m_0 is not None and sigma_0 is not None:
And it seems to have made forward progress.
I also needed to replace
logISweights = log_f - sc.misc.logsumexp(log_f)
with
logISweights = log_f - sc.special.logsumexp(log_f)