pybasicbayes icon indicating copy to clipboard operation
pybasicbayes copied to clipboard

error with numpy v1.12.0

Open dafnevk opened this issue 8 years ago • 1 comments

With the newest version of numpy (v1.12.0) I get the following error when running the tests (and also when using pybasicbayes with the pyhsmm package):

====================================================================== ERROR: test_gaussian.TestGaussian.test_empirical_bayes

Traceback (most recent call last): File "/home/dafne/anaconda2/envs/ucltest/lib/python2.7/site-packages/nose/case.py", line 197, in runTest self.test(*self.arg) File "/home/dafne/timeseries/pybasicbayes/tests/test_gaussian.py", line 46, in test_empirical_bayes distributions.Gaussian().empirical_bayes(data).hypparams File "/home/dafne/timeseries/pybasicbayes/pybasicbayes/distributions/gaussian.py", line 250, in empirical_bayes self.resample() # intialize from prior given new hyperparameters File "/home/dafne/timeseries/pybasicbayes/pybasicbayes/distributions/gaussian.py", line 271, in resample self.natural_hypparam + self._get_statistics(data,D))) File "/home/dafne/timeseries/pybasicbayes/pybasicbayes/util/stats.py", line 210, in sample_niw lmbda = sample_invwishart(lmbda,nu) File "/home/dafne/timeseries/pybasicbayes/pybasicbayes/util/stats.py", line 224, in sample_invwishart x = np.random.randn(nu,n) File "mtrand.pyx", line 1404, in mtrand.RandomState.randn (numpy/random/mtrand/mtrand.c:19843) File "mtrand.pyx", line 1534, in mtrand.RandomState.standard_normal (numpy/random/mtrand/mtrand.c:20368) File "mtrand.pyx", line 167, in mtrand.cont0_array (numpy/random/mtrand/mtrand.c:6127) TypeError: 'numpy.float64' object cannot be interpreted as an index

dafnevk avatar Feb 21 '17 13:02 dafnevk

Hi @dafnevk have you been able to find a resolution to this issue? I'm having the same problem!

r-shruthi11 avatar Apr 23 '18 19:04 r-shruthi11